You are here

static function LookupPath::checkPath in Optimizely 8.0

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

Ensure that $path starts with a forward slash because the alias_manager requires it.

2 calls to LookupPath::checkPath()
LookupPath::lookupPathAlias in src/LookupPath.php
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.
LookupPath::lookupSystemPath in src/LookupPath.php
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.

File

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

Class

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

Namespace

Drupal\optimizely

Code

static function checkPath($path) {
  return $path[0] == '/' ? $path : '/' . $path;
}