function RouteCompiler::getPatternOutline

Same name in other branches
  1. 9 core/lib/Drupal/Core/Routing/RouteCompiler.php \Drupal\Core\Routing\RouteCompiler::getPatternOutline()
  2. 8.9.x core/lib/Drupal/Core/Routing/RouteCompiler.php \Drupal\Core\Routing\RouteCompiler::getPatternOutline()
  3. 11.x 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

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.