function CurrentPathStack::setPath
Same name in other branches
- 8.9.x core/lib/Drupal/Core/Path/CurrentPathStack.php \Drupal\Core\Path\CurrentPathStack::setPath()
- 10 core/lib/Drupal/Core/Path/CurrentPathStack.php \Drupal\Core\Path\CurrentPathStack::setPath()
- 11.x core/lib/Drupal/Core/Path/CurrentPathStack.php \Drupal\Core\Path\CurrentPathStack::setPath()
Sets the current path.
Parameters
string $path: The path.
\Symfony\Component\HttpFoundation\Request $request: (optional) The request.
Return value
$this
File
-
core/
lib/ Drupal/ Core/ Path/ CurrentPathStack.php, line 72
Class
- CurrentPathStack
- Represents the current path for the current request.
Namespace
Drupal\Core\PathCode
public function setPath($path, Request $request = NULL) {
if (!isset($request)) {
$request = $this->requestStack
->getCurrentRequest();
}
$this->paths[$request] = $path;
return $this;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.