yii\web\Request::resolveRequestUri PHP Метод

resolveRequestUri() защищенный Метод

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
Результат string | boolean the request URI portion for the currently requested URL. Note that the URI returned is URL-encoded.
    protected function resolveRequestUri()
    {
        if (isset($_SERVER['HTTP_X_REWRITE_URL'])) {
            // IIS
            $requestUri = $_SERVER['HTTP_X_REWRITE_URL'];
        } elseif (isset($_SERVER['REQUEST_URI'])) {
            $requestUri = $_SERVER['REQUEST_URI'];
            if ($requestUri !== '' && $requestUri[0] !== '/') {
                $requestUri = preg_replace('/^(http|https):\\/\\/[^\\/]+/i', '', $requestUri);
            }
        } elseif (isset($_SERVER['ORIG_PATH_INFO'])) {
            // IIS 5.0 CGI
            $requestUri = $_SERVER['ORIG_PATH_INFO'];
            if (!empty($_SERVER['QUERY_STRING'])) {
                $requestUri .= '?' . $_SERVER['QUERY_STRING'];
            }
        } else {
            throw new InvalidConfigException('Unable to determine the request URI.');
        }
        return $requestUri;
    }

Usage Example

Пример #1
0
 /**
  * 
  * @return string
  */
 protected function resolveRequestUri()
 {
     if ($this->_requestUri === null) {
         $this->_requestUri = MultiLanguage::processLangInUrl(parent::resolveRequestUri());
     }
     return $this->_requestUri;
 }
All Usage Examples Of yii\web\Request::resolveRequestUri