You are here

public static function LookupPath::checkPath in Optimizely 8

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

Ensure that $path starts with a forward slash.

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.
LookupPath::lookupSystemPath in src/LookupPath.php
Helper function to lookup a system path, given a path alias.

File

src/LookupPath.php, line 43

Class

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

Namespace

Drupal\optimizely

Code

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