You are here

public function AliasManagerDecorator::getPathByAlias in Drupal 8

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.

Overrides AliasManagerInterface::getPathByAlias

File

core/modules/path_alias/tests/modules/path_alias_deprecated_test/src/AliasManagerDecorator.php, line 32

Class

AliasManagerDecorator
Test alias manager decorator.

Namespace

Drupal\path_alias_deprecated_test

Code

public function getPathByAlias($alias, $langcode = NULL) {
  $this->aliasManager
    ->getPathByAlias($alias, $langcode);
}