public CurrentPathStack::getPath($request = NULL)
Returns the path of the current request.
\Symfony\Component\HttpFoundation\Request $request: (optional) The request.
string Returns the path, without leading slashes.
public function getPath($request = NULL) { if (!isset($request)) { $request = $this->requestStack->getCurrentRequest(); } if (!isset($this->paths[$request])) { $this->paths[$request] = $request->getPathInfo(); } return $this->paths[$request]; }
© 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::getPath/8.1.x