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


PHP CController::redirect方法代码示例

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


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

示例1: redirect

 /**
  * @param mixed $url
  * @param bool $terminate
  * @param int $statusCode
  */
 public function redirect($url, $terminate = true, $statusCode = 302)
 {
     if ($url == ':back' && isset($_SERVER['HTTP_REFERER'])) {
         $url = $_SERVER['HTTP_REFERER'];
     }
     parent::redirect($url, $terminate, $statusCode);
 }
开发者ID:GatuZa,项目名称:test-app,代码行数:12,代码来源:SiteController.php

示例2: redirect

 /**
        If there's a returnTo, then use it.
        XXX this may break with ajax, watch out
     **/
 public function redirect($url, $terminate = true, $statusCode = 302)
 {
     if (isset($_GET['returnTo'])) {
         // NOTE: do NOT use an array!!
         parent::redirect(urldecode($_GET['returnTo']));
     } else {
         parent::redirect($url, $terminate, $statusCode);
     }
 }
开发者ID:kenrestivo,项目名称:ossasep,代码行数:13,代码来源:Controller.php

示例3: filter

 public function filter($filterChain)
 {
     if (!$this->preFilter($filterChain)) {
         if (Yii::app()->controller->id === $this->login_controller) {
             CController::redirect($this->login_action);
         } else {
             CController::redirect($this->login_controller . '/' . $this->login_action);
         }
     } else {
         $filterChain->run();
     }
 }
开发者ID:vin120,项目名称:wap,代码行数:12,代码来源:PerformanceFilter.php

示例4: beforeControllerAction

 public function beforeControllerAction($controller, $action)
 {
     if (parent::beforeControllerAction($controller, $action)) {
         if (Yii::app()->user->isGuest) {
             CController::redirect('index.php?r=login');
         }
         if (!in_array($this->name, ModuluserK::modulUser(Yii::app()->user->id))) {
             throw new CHttpException(401, Yii::t('mds', 'You are prohibited to access this page. Contact Super Administrator'));
         }
         return true;
     } else {
         return false;
     }
 }
开发者ID:nelitaaas,项目名称:Tugas-Besar,代码行数:14,代码来源:KepegawaianModule.php

示例5: redirect

 /**
  * Phương thức redirect($url, $terminate=true, $statusCode=302) dùng để redirect user đến url
  * 
  * @param $url string/array
  * @param $terminate boolean
  * @param $statusCode int 
  */
 public function redirect($url, $terminate = true, $statusCode = 302)
 {
     if (!empty($this->_redirectOptions)) {
         if (is_array($url)) {
             $route = isset($url[0]) ? $url[0] : '';
             $url = $this->createUrl($route, array_splice($url, 1));
         }
         $this->_redirectOptions['url'] = $url;
         $this->render('//common/redirect', array('redirectOptions' => $this->_redirectOptions));
         Yii::app()->end();
     } else {
         parent::redirect($url, $terminate, $statusCode);
     }
 }
开发者ID:qkongvan,项目名称:k6-thuc-pham,代码行数:21,代码来源:HController.php

示例6: redirect

    public function redirect($params)
    {
        if (isset($_GET['popup']))
        {
            if (is_array($params))
            {
                $view = array_shift($params);
                $params['popup'] = 1;
                array_unshift($params, $view);
            }
        }

        parent::redirect($params);
    }
开发者ID:nizsheanez,项目名称:kur.ru,代码行数:14,代码来源:Controller.php

示例7: redirect

 /**
  * Redirects the browser to a given URL.
  *
  * @param string $url The URL to redirect the browser to.
  * @param bool   $terminate Whether the request should be terminated.
  * @param int    $statusCode The status code to accompany the redirect. (Default is 302.)
  *
  * @return null
  */
 public function redirect($url, $terminate = true, $statusCode = 302)
 {
     if (is_string($url)) {
         $url = UrlHelper::getUrl($url);
     }
     if ($url !== null) {
         parent::redirect($url, $terminate, $statusCode);
     }
 }
开发者ID:codeforamerica,项目名称:oakland-beta,代码行数:18,代码来源:BaseController.php

示例8: redirect

 public function redirect($url, $terminate = true, $statusCode = 302)
 {
     if (Yii::app()->request->isAjaxRequest) {
         return;
     }
     parent::redirect($url, $terminate, $statusCode);
 }
开发者ID:hung5s,项目名称:yap,代码行数:7,代码来源:XController.php


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