本文整理汇总了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();
}