function Request::getPathInfo
Returns the path being requested relative to the executed script.
The path info always starts with a /.
Suppose this request is instantiated from /mysite on localhost:
- http://localhost/mysite returns an empty string
- http://localhost/mysite/about returns '/about'
- http://localhost/mysite/enco%20ded returns '/enco%20ded'
- http://localhost/mysite/about?var=1 returns '/about'
Return value
string The raw path (i.e. not urldecoded)
2 calls to Request::getPathInfo()
- Request::getRelativeUriForPath in vendor/
symfony/ http-foundation/ Request.php - Returns the path as relative reference from the current Request path.
- Request::getUri in vendor/
symfony/ http-foundation/ Request.php - Generates a normalized URI (URL) for the Request.
File
-
vendor/
symfony/ http-foundation/ Request.php, line 796
Class
- Request
- Request represents an HTTP request.
Namespace
Symfony\Component\HttpFoundationCode
public function getPathInfo() : string {
return $this->pathInfo ??= $this->preparePathInfo();
}