You are here

public static function RouteCompiler::getPatternOutline in Drupal 9

Same name and namespace in other branches
  1. 8 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 the string '%'.

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::overrideAppliesPathAndMethod in core/modules/views/src/Plugin/views/display/PathPluginBase.php
Determines whether an override for the path and method should happen.
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 76

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