resolveRequestUri() protected method

This refers to the portion that is after the [[hostInfo]] part. It includes the [[queryString]] part if any. The implementation of this method referenced Zend_Controller_Request_Http in Zend Framework.
protected resolveRequestUri ( ) : string | boolean
return string | boolean the request URI portion for the currently requested URL. Note that the URI returned is URL-encoded.
Example #1
0
 /**
  * 
  * @return string
  */
 protected function resolveRequestUri()
 {
     if ($this->_requestUri === null) {
         $this->_requestUri = MultiLanguage::processLangInUrl(parent::resolveRequestUri());
     }
     return $this->_requestUri;
 }
Example #2
0
 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;
 }
Example #3
0
 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;
 }
Example #4
0
 /**
  * @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;
 }
Example #5
0
 protected function resolveRequestUri()
 {
     $selected = Settings::findOne('backend_language')->value;
     Languages::setCurrent($selected ? $selected : Languages::getDefaultLanguage()->url);
     return parent::resolveRequestUri();
 }