You are here

public static function RouteCompiler::getPatternOutline in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Routing/RouteCompiler.php \Drupal\Core\Routing\RouteCompiler::getPatternOutline()

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.

3 calls to RouteCompiler::getPatternOutline()
PathPluginBase::alterRoutes in core/modules/views/src/Plugin/views/display/PathPluginBase.php
Alters a collection of routes and replaces definitions to the view.
RouteCompiler::compile in core/lib/Drupal/Core/Routing/RouteCompiler.php
Compiles the current route instance.
RouteProvider::getRoutesByPattern in core/lib/Drupal/Core/Routing/RouteProvider.php
Get all routes which match a certain pattern.

File

core/lib/Drupal/Core/Routing/RouteCompiler.php, line 78
Contains \Drupal\Core\Routing\RouteCompiler.

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);
}