You are here

public function RouteProvider::getRoutesByPattern in Drupal 9

Same name in this branch
  1. 9 core/tests/Drupal/KernelTests/RouteProvider.php \Drupal\KernelTests\RouteProvider::getRoutesByPattern()
  2. 9 core/lib/Drupal/Core/Routing/RouteProvider.php \Drupal\Core\Routing\RouteProvider::getRoutesByPattern()
Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/RouteProvider.php \Drupal\KernelTests\RouteProvider::getRoutesByPattern()
  2. 10 core/tests/Drupal/KernelTests/RouteProvider.php \Drupal\KernelTests\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. 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/tests/Drupal/KernelTests/RouteProvider.php, line 69

Class

RouteProvider
Rebuilds the router when the provider is instantiated.

Namespace

Drupal\KernelTests

Code

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