You are here

public static function LookupPath::checkPath in Optimizely 8.3

Ensure that $path starts with a forward slash.

The alias_manager requires it.

2 calls to LookupPath::checkPath()
LookupPath::lookupPathAlias in src/Util/LookupPath.php
Helper function to lookup a path alias, given a path.
LookupPath::lookupSystemPath in src/Util/LookupPath.php
Helper function to lookup a system path, given a path alias.

File

src/Util/LookupPath.php, line 43

Class

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

Namespace

Drupal\optimizely\Util

Code

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