当前位置: 首页>>代码示例>>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;未经允许,请勿转载。