本文整理匯總了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;
}
示例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;
}
示例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;
}
示例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;
}
示例5: resolveRequestUri
protected function resolveRequestUri()
{
$selected = Settings::findOne('backend_language')->value;
Languages::setCurrent($selected ? $selected : Languages::getDefaultLanguage()->url);
return parent::resolveRequestUri();
}