CurrentPathStack
class CurrentPathStack (View source)
Represents the current path for the current request.
Note: You should not rely on paths but rather on route names / parameters or other indicators like context. For some fundamental parts, like routing or path processing, there is unfortunately no way around dealing with paths.
Properties
| protected SplObjectStorage | $paths | Static cache of paths. |
|
| protected RequestStack | $requestStack | The request stack. |
Methods
__construct(RequestStack $request_stack)
Constructs a new CurrentPathStack instance.
string
getPath(Request $request = NULL)
Returns the path of the current request.
$this
setPath(string $path, Request $request = NULL)
Sets the current path.
Details
__construct(RequestStack $request_stack)
Constructs a new CurrentPathStack instance.
string
getPath(Request $request = NULL)
Returns the path of the current request.
$this
setPath(string $path, Request $request = NULL)
Sets the current path.