interface AliasManagerInterface (View source)

Find an alias for a path and vice versa.

Methods

string
getPathByAlias(string $alias, string $langcode = NULL)

Given the alias, return the path it represents.

string
getAliasByPath(string $path, string $langcode = NULL)

Given a path, return the alias.

cacheClear($source = NULL)

Clears the static caches in alias manager and rebuilds the whitelist.

Details

string getPathByAlias(string $alias, string $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.

Exceptions

InvalidArgumentException

string getAliasByPath(string $path, string $langcode = NULL)

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.

Exceptions

InvalidArgumentException

cacheClear($source = NULL)

Clears the static caches in alias manager and rebuilds the whitelist.

Parameters

$source

Source path of the alias that is being inserted/updated. If omitted, the entire lookup static cache will be cleared and the whitelist will be rebuilt.