W3cubDocs

/Drupal 8

public function AliasManagerInterface::getPathByAlias

public AliasManagerInterface::getPathByAlias($alias, $langcode = NULL)

Given the alias, return the path it represents.

Parameters

string $alias: An alias.

string $langcode: An optional language code to look up the path in.

Return value

string The path represented by alias, or the alias if no path was found.

Throws

\InvalidArgumentException Thrown when the path does not start with a slash.

File

core/lib/Drupal/Core/Path/AliasManagerInterface.php, line 26

Class

AliasManagerInterface
Find an alias for a path and vice versa.

Namespace

Drupal\Core\Path

Code

public function getPathByAlias($alias, $langcode = NULL);

© 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!AliasManagerInterface.php/function/AliasManagerInterface::getPathByAlias/8.1.x