You are here

static function LookupPath::lookupPathAlias in Optimizely 8.0

Same name and namespace in other branches
  1. 8 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
PathChecker::validatePaths in src/PathChecker.php
validatePaths()
ProjectListForm::buildForm in src/ProjectListForm.php
Form constructor.

File

src/LookupPath.php, line 20
Contains \Drupal\optimizely\LookupPath

Class

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

Namespace

Drupal\optimizely

Code

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