當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Request::resolveRequestUri方法代碼示例

本文整理匯總了PHP中yii\web\Request::resolveRequestUri方法的典型用法代碼示例。如果您正苦於以下問題:PHP Request::resolveRequestUri方法的具體用法?PHP Request::resolveRequestUri怎麽用?PHP Request::resolveRequestUri使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在yii\web\Request的用法示例。


在下文中一共展示了Request::resolveRequestUri方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: resolveRequestUri

 /**
  * 
  * @return string
  */
 protected function resolveRequestUri()
 {
     if ($this->_requestUri === null) {
         $this->_requestUri = MultiLanguage::processLangInUrl(parent::resolveRequestUri());
     }
     return $this->_requestUri;
 }
開發者ID:filamentv,項目名稱:yii2-multilang,代碼行數:11,代碼來源:Request.php

示例2: resolveRequestUri

 protected function resolveRequestUri()
 {
     if ($this->_requestUri === null) {
         $this->_requestUri = parent::resolveRequestUri();
         if (P::$app->getUrlManager()->enableAppendLang) {
             $this->_requestUri = MultilangHelper::resolveLangFromUrl($this->_requestUri);
         }
     }
     return $this->_requestUri;
 }
開發者ID:filsh,項目名稱:yii2-platform,代碼行數:10,代碼來源:Request.php

示例3: resolveRequestUri

 protected function resolveRequestUri()
 {
     $requestUri = parent::resolveRequestUri();
     $baseUrl = $this->getBaseUrl();
     if ($baseUrl) {
         $requestUri = substr($requestUri, strlen($baseUrl));
     }
     $requestUriToList = explode('/', $requestUri);
     $lang_url = isset($requestUriToList[1]) ? $requestUriToList[1] : null;
     Languages::setCurrent($lang_url);
     if ($lang_url !== null && $lang_url === Languages::getCurrent()->url && strpos($requestUri, Languages::getCurrent()->url) === 1) {
         $requestUri = ($baseUrl ? $baseUrl : '') . substr($requestUri, strlen(Languages::getCurrent()->url) + 1);
     }
     return $requestUri;
 }
開發者ID:lukianovva,項目名稱:clover,代碼行數:15,代碼來源:LangRequest.php

示例4: resolveRequestUri

 /**
  * @return bool|string
  */
 protected function resolveRequestUri()
 {
     $pattern = [];
     $resolveRequestUri = parent::resolveRequestUri();
     if (Yii::$app->getUrlManager()->enablePrettyUrl === true) {
         $pattern[] = '/' . preg_replace('/\\//', '\\/', Yii::$app->getUrlManager()->suffix) . '/';
     }
     if (Yii::$app->getUrlManager()->showScriptName === true) {
         $pattern[] = '/' . preg_replace('/\\//', '\\/', $this->getScriptUrl()) . '/';
     }
     $requestUri = preg_replace($pattern, '', $resolveRequestUri);
     list($language, ) = explode('/', trim($requestUri, '/'));
     if (Language::isLanguage($language)) {
         Language::setCurrent($language);
     } else {
         Language::setCurrent($this->getPreferredLanguage(ArrayHelper::getColumn(Language::listing(), 'iso')));
     }
     return $resolveRequestUri;
 }
開發者ID:apurey,項目名稱:cmf,代碼行數:22,代碼來源:LangRequest.php

示例5: resolveRequestUri

 protected function resolveRequestUri()
 {
     $selected = Settings::findOne('backend_language')->value;
     Languages::setCurrent($selected ? $selected : Languages::getDefaultLanguage()->url);
     return parent::resolveRequestUri();
 }
開發者ID:lukianovva,項目名稱:clover,代碼行數:6,代碼來源:LanguageRequest.php


注:本文中的yii\web\Request::resolveRequestUri方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。