lithium\action\Request::_url()
Extract the url from REQUEST_URI
&& PHP_SELF
environment variables.
Parameters
-
string
The
base url If
null
, environment variables will be used instead.
Returns
stringSource
protected function _url($url = null) {
if ($url !== null) {
return '/' . trim($url, '/');
} elseif ($uri = $this->env('REQUEST_URI')) {
list($uri) = explode('?', $uri, 2);
$base = '/^' . preg_quote($this->_base, '/') . '/';
return '/' . trim(preg_replace($base, '', $uri), '/') ?: '/';
}
return '/';
}