public function AliasManagerDecorator::getAliasByPath in Drupal 8
Given a path, return the alias.
Parameters
string $path: A path.
string $langcode: An optional language code to look up the path in.
Return value
string An alias that represents the path, or path if no alias was found.
Throws
\InvalidArgumentException Thrown when the path does not start with a slash.
Overrides AliasManagerInterface::getAliasByPath
File
- core/
modules/ path_alias/ tests/ modules/ path_alias_deprecated_test/ src/ AliasManagerDecorator.php, line 39
Class
- AliasManagerDecorator
- Test alias manager decorator.
Namespace
Drupal\path_alias_deprecated_testCode
public function getAliasByPath($path, $langcode = NULL) {
return $this->aliasManager
->getAliasByPath($path, $langcode);
}