當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。