I know of the method \Symfony\Component\HttpFoundation\Request::getPathInfo()
however in the docs it states that, that only returns the path of the request which is "relative" to the "executed script".How can I get the full path?and on a second note what does 'executed script' mean when all requests are going through the front controller?
$request->getUri() return the absolute url => http://example.com/app.php/path
$request->getRequestUri() return the absolute path => /app.php/path
$request->getPathInfo() return the path corresponding to your controller's action => /path
getPathInfo
just subtract the executed script (/app.php) from the request uri, so it's called the path relative to the executed script.
来源:https://stackoverflow.com/questions/25601869/how-to-get-the-path-of-the-request-in-symfony2