当前位置: 首页>>代码示例>>PHP>>正文


PHP AuxLib::getRequestUrl方法代码示例

本文整理汇总了PHP中AuxLib::getRequestUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP AuxLib::getRequestUrl方法的具体用法?PHP AuxLib::getRequestUrl怎么用?PHP AuxLib::getRequestUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AuxLib的用法示例。


在下文中一共展示了AuxLib::getRequestUrl方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 public function init()
 {
     if (!$this->action && Yii::app()->params->isPhoneGap) {
         $this->action = AuxLib::getRequestUrl();
     }
     return parent::init();
 }
开发者ID:tymiles003,项目名称:X2CRM,代码行数:7,代码来源:MobileActiveForm.php

示例2: array

                $menuItems[] = array('label' => Yii::t('app', $title), 'url' => array("/{$name}/{$defaultAction}"), 'itemOptions' => array('class' => 'top-bar-module-link'), 'active' => $active);
            }
        } else {
            $page = Docs::model()->findByAttributes(array('name' => ucfirst(mb_ereg_replace(':', ':', $title))));
            if (isset($page) && Yii::app()->user->checkAccess('DocsView')) {
                $id = $page->id;
                $menuItems[] = array('label' => ucfirst($title), 'url' => array('/docs/' . $id . '?static=true'), 'itemOptions' => array('class' => 'top-bar-module-link'), 'active' => Yii::app()->request->requestUri == $scriptUrl . '/docs/' . $id . '?static=true' ? true : null);
            }
        }
    } elseif ($moduleItem->moduleType === 'link') {
        if (isset($moduleItem->linkHref)) {
            $menuItems[] = array('label' => $moduleItem->title, 'url' => $moduleItem->linkHref, 'itemOptions' => array('class' => 'top-bar-module-link'), 'linkOptions' => $moduleItem->linkOpenInNewTab ? array('target' => '_blank') : array(), 'active' => AuxLib::getRequestUrl() === $moduleItem->linkHref);
        }
    } elseif ($moduleItem->moduleType === 'recordLink') {
        if (isset($moduleItem->linkRecordType) && isset($moduleItem->linkRecordId) && ($model = X2Model::model2($moduleItem->linkRecordType)) && ($record = $model->findByPk($moduleItem->linkRecordId)) && $record->asa('X2LinkableBehavior') && $record->isVisibleTo(Yii::app()->params->profile->user)) {
            $menuItems[] = array('label' => $record->name, 'url' => $record->getUrl(), 'itemOptions' => array('class' => 'top-bar-module-link'), 'linkOptions' => $moduleItem->linkOpenInNewTab ? array('target' => '_blank') : array(), 'active' => AuxLib::getRequestUrl() == $record->getUrl());
        }
    }
}
$maxMenuItems = 4;
//check if menu has too many items to fit nicely
$menuItemCount = count($menuItems);
if ($menuItemCount > $maxMenuItems) {
    end($menuItems);
    //move the last few menu items into the "More" dropdown
    for ($i = 0; $i < $menuItemCount - ($maxMenuItems - 1); $i++) {
        $menuItems[key($menuItems)]['itemOptions'] = array('style' => 'display: none;', 'class' => 'top-bar-module-link');
        prev($menuItems);
    }
}
//add "More" to main menu
开发者ID:tymiles003,项目名称:X2CRM,代码行数:31,代码来源:main.php

示例3: array

</h1>
</div>

<div class='refresh-content' data-refresh-selector='#header .header-content-right'>
    <div class='search-button ui-btn'>
        <i class='fa fa-search'></i>
    </div>
</div>

<div class='refresh-content' data-refresh-selector='#header .header-content-center'>
    <div class='search-box' style='display: none;'>
        <div class='search-cancel-button ui-btn'>
            <i class='fa fa-arrow-left'></i>
        </div>
        <form action='<?php 
echo AuxLib::getRequestUrl();
?>
'>
            <input type='text' name='<?php 
$htmlOptions = array();
$attr = 'name';
CHtml::resolveNameId($model, $attr, $htmlOptions);
echo $htmlOptions['name'];
?>
'
             placeholder='<?php 
echo 'Search ' . ucfirst($title);
?>
' />
        </form>
        <div class='search-clear-button ui-btn'>
开发者ID:tymiles003,项目名称:X2CRM,代码行数:31,代码来源:recordIndex.php

示例4: actionLogin

 /**
  * Displays the login page
  */
 public function actionLogin()
 {
     if (Yii::app()->user->isInitialized && !Yii::app()->user->isGuest) {
         $this->redirect($this->createAbsoluteUrl('home'));
         return;
     }
     // allows client to detect login page redirect
     if ($this->isAjaxRequest()) {
         header('X2-Requested-Url: ' . AuxLib::getRequestUrl());
     }
     $model = new LoginForm();
     $model->useCaptcha = false;
     if ($this->loginRequiresCaptcha()) {
         $model->useCaptcha = true;
         $model->setScenario('loginWithCaptcha');
     }
     // if it is ajax validation request
     /* this would bypass captcha. commented out to prevent security vulnerability */
     /*if (isset($_POST['ajax']) && $_POST['ajax'] === 'login-form') {
           echo CActiveForm::validate($model);
           Yii::app()->end();
       }*/
     // collect user input data
     if (isset($_POST['LoginForm'])) {
         $this->login($model, true);
     }
     // display the login form
     $this->render('login', array('model' => $model));
 }
开发者ID:dsyman2,项目名称:X2CRM,代码行数:32,代码来源:MobileController.php


注:本文中的AuxLib::getRequestUrl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。