You are here

public static function LookupPath::lookupPathAlias in Optimizely 8

Same name and namespace in other branches
  1. 8.0 src/LookupPath.php \Drupal\optimizely\LookupPath::lookupPathAlias()

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/PathChecker.php
Lookup all alternatives to the group of paths - alias, <front>.
PathChecker::validatePaths in src/PathChecker.php
Validate the target paths.
ProjectListForm::buildForm in src/ProjectListForm.php
Form constructor.

File

src/LookupPath.php, line 17

Class

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

Namespace

Drupal\optimizely

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;
}