You are here

public static function LookupPath::lookupSystemPath in Optimizely 8

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

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

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.

2 calls to LookupPath::lookupSystemPath()
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.

File

src/LookupPath.php, line 31

Class

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

Namespace

Drupal\optimizely

Code

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