You are here

public function RouteProviderLazyBuilder::getRoutesByPattern in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Routing/RouteProviderLazyBuilder.php \Drupal\Core\Routing\RouteProviderLazyBuilder::getRoutesByPattern()
  2. 9 core/lib/Drupal/Core/Routing/RouteProviderLazyBuilder.php \Drupal\Core\Routing\RouteProviderLazyBuilder::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. The collection may be empty and will be sorted from highest to lowest fit (match of path parts) and then in ascending order by route name for routes with the same fit.

Overrides RouteProviderInterface::getRoutesByPattern

File

core/lib/Drupal/Core/Routing/RouteProviderLazyBuilder.php, line 103

Class

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

Namespace

Drupal\Core\Routing

Code

public function getRoutesByPattern($pattern) {
  return $this
    ->getRouteProvider()
    ->getRoutesByPattern($pattern);
}