You are here

public function AliasManagerInterface::getPathByAlias in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Path/AliasManagerInterface.php \Drupal\Core\Path\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.

2 methods override AliasManagerInterface::getPathByAlias()
AliasManager::getPathByAlias in core/lib/Drupal/Core/Path/AliasManager.php
Given the alias, return the path it represents.
MockAliasManager::getPathByAlias in core/modules/system/src/Tests/Routing/MockAliasManager.php
Given the alias, return the path it represents.

File

core/lib/Drupal/Core/Path/AliasManagerInterface.php, line 31
Contains \Drupal\Core\Path\AliasManagerInterface.

Class

AliasManagerInterface
Find an alias for a path and vice versa.

Namespace

Drupal\Core\Path

Code

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