You are here

function _lookup_system_path in Optimizely 8

Same name and namespace in other branches
  1. 8.3 optimizely.module \_lookup_system_path()
  2. 8.0 optimizely.module \_lookup_system_path()

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.

1 call to _lookup_system_path()
optimizely_page_attachments in ./optimizely.module
Implements hook_page_attachments().

File

./optimizely.module, line 275
Optimizely module.

Code

function _lookup_system_path($alias) {
  $alias = _check_path($alias);
  $path = \Drupal::service('path.alias_manager')
    ->getPathByAlias($alias);
  return strcmp($path, $alias) == 0 ? FALSE : $path;
}