Drupal 8  8.0.2
CurrentPathStack Class Reference

Public Member Functions

 __construct (RequestStack $request_stack)
 
 getPath ($request=NULL)
 
 setPath ($path, $request=NULL)
 

Protected Attributes

 $paths
 
 $requestStack
 

Detailed Description

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.

Constructor & Destructor Documentation

__construct ( RequestStack  $request_stack)

Constructs a new CurrentPathStack instance.

Parameters
\Symfony\Component\HttpFoundation\RequestStack$request_stackThe request stack.

References Drupal\requestStack().

Here is the call graph for this function:

Member Function Documentation

getPath (   $request = NULL)

Returns the path of the current request.

Parameters
\Symfony\Component\HttpFoundation\Request$request(optional) The request.
Returns
string Returns the path, without leading slashes.

References Drupal\requestStack().

Here is the call graph for this function:

setPath (   $path,
  $request = NULL 
)

Sets the current path.

Parameters
string$pathThe path.
\Symfony\Component\HttpFoundation\Request$request(optional) The request.
Returns
$this

References Drupal\requestStack().

Here is the call graph for this function:


The documentation for this class was generated from the following file: