function AliasManagerInterface::getPathByAlias

Same name in other branches
  1. 9 core/modules/path_alias/src/AliasManagerInterface.php \Drupal\path_alias\AliasManagerInterface::getPathByAlias()
  2. 10 core/modules/path_alias/src/AliasManagerInterface.php \Drupal\path_alias\AliasManagerInterface::getPathByAlias()
  3. 11.x core/modules/path_alias/src/AliasManagerInterface.php \Drupal\path_alias\AliasManagerInterface::getPathByAlias()

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.

3 methods override AliasManagerInterface::getPathByAlias()
AliasManager::getPathByAlias in core/lib/Drupal/Core/Path/AliasManager.php
Given the alias, return the path it represents.
AliasManagerDecorator::getPathByAlias in core/modules/path_alias/tests/modules/path_alias_deprecated_test/src/AliasManagerDecorator.php
Given the alias, return the path it represents.
NewAliasManager::getPathByAlias in core/modules/path_alias/tests/modules/path_alias_deprecated_test/src/NewAliasManager.php
Given the alias, return the path it represents.

File

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

Class

AliasManagerInterface
Find an alias for a path and vice versa.

Namespace

Drupal\Core\Path

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.