本文整理匯總了PHP中Thelia\Core\HttpFoundation\Request::getUri方法的典型用法代碼示例。如果您正苦於以下問題:PHP Request::getUri方法的具體用法?PHP Request::getUri怎麽用?PHP Request::getUri使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Thelia\Core\HttpFoundation\Request
的用法示例。
在下文中一共展示了Request::getUri方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getParseUrlByCurrentLocale
/**
* @return array
*
* At least one element will be present within the array.
* Potential keys within this array are:
* scheme - e.g. http
* host
* port
* user
* pass
* path
* query - after the question mark ?
* fragment - after the hashmark #
*/
protected function getParseUrlByCurrentLocale()
{
// for one domain by lang
if ((int) ConfigQuery::read('one_domain_foreach_lang', 0) === 1) {
// $langUrl = $this->session->getLang()->getUrl();
$langUrl = LangQuery::create()->findOneByLocale($this->session->getLang()->getLocale())->getUrl();
if (!empty($langUrl) && false !== ($parse = parse_url($langUrl))) {
return $parse;
}
}
// return config url site
$urlSite = ConfigQuery::read('url_site');
if (!empty($urlSite) && false !== ($parse = parse_url($urlSite))) {
return $parse;
}
// return current host
return parse_url($this->request->getUri());
}