You are here

public static function LookupPath::lookupPathAlias in Optimizely 8.3

Helper function to lookup a path alias, given a path.

This function acts as an adapter and passes back a return value like those of drupal_lookup_path(), which has been removed as of Drupal 8.

3 calls to LookupPath::lookupPathAlias()
PathChecker::collectAlias in src/Util/PathChecker.php
Lookup all alternatives to the group of paths - alias, <front>.
PathChecker::validatePaths in src/Util/PathChecker.php
Validate the target paths.
ProjectListForm::buildForm in src/Form/ProjectListForm.php
Form constructor.

File

src/Util/LookupPath.php, line 17

Class

LookupPath
Implements methods for looking up path aliases and system paths.

Namespace

Drupal\optimizely\Util

Code

public static function lookupPathAlias($path) {
  $path = LookupPath::checkPath($path);
  $alias = \Drupal::service('path.alias_manager')
    ->getAliasByPath($path);
  return strcmp($alias, $path) == 0 ? FALSE : $alias;
}