public static function RouteCompiler::getPatternOutline

public static RouteCompiler::getPatternOutline($path)

Returns the pattern outline.

The pattern outline is the path pattern but normalized so that all placeholders are equal strings and default values are removed.

Parameters

string $path: The path for which we want the normalized outline.

Return value

string The path pattern outline.

File

core/lib/Drupal/Core/Routing/RouteCompiler.php, line 73

Class

RouteCompiler
Compiler to generate derived information from a Route necessary for matching.

Namespace

Drupal\Core\Routing

Code

public static function getPatternOutline($path) {
  return preg_replace('#\{\w+\}#', '%', $path);
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Routing!RouteCompiler.php/function/RouteCompiler::getPatternOutline/8.1.x