public function CurrentPathStack::setPath

public CurrentPathStack::setPath($path, $request = NULL)

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 70

Class

CurrentPathStack
Represents the current path for the current request.

Namespace

Drupal\Core\Path

Code

public function setPath($path, $request = NULL) {
  if (!isset($request)) {
    $request = $this->requestStack->getCurrentRequest();
  }
  $this->paths[$request] = $path;

  return $this;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Path!CurrentPathStack.php/function/CurrentPathStack::setPath/8.1.x