You are here

public function RouteProvider::getRoutesByPattern in Zircon Profile 8

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

Get all routes which match a certain pattern.

Parameters

string $pattern: The route pattern to search for (contains {} as placeholders).

Return value

\Symfony\Component\Routing\RouteCollection Returns a route collection of matching routes.

Overrides RouteProviderInterface::getRoutesByPattern

File

core/lib/Drupal/Core/Routing/RouteProvider.php, line 310
Contains \Drupal\Core\Routing\RouteProvider.

Class

RouteProvider
A Route Provider front-end for all Drupal-stored routes.

Namespace

Drupal\Core\Routing

Code

public function getRoutesByPattern($pattern) {
  $path = RouteCompiler::getPatternOutline($pattern);
  return $this
    ->getRoutesByPath($path);
}