function Router::applyRouteFilters
Same name in other branches
- 8.9.x core/lib/Drupal/Core/Routing/Router.php \Drupal\Core\Routing\Router::applyRouteFilters()
- 10 core/lib/Drupal/Core/Routing/Router.php \Drupal\Core\Routing\Router::applyRouteFilters()
- 11.x core/lib/Drupal/Core/Routing/Router.php \Drupal\Core\Routing\Router::applyRouteFilters()
Applies all route filters to a given route collection.
This method reduces the sets of routes further down, for example by checking the HTTP method.
Parameters
\Symfony\Component\Routing\RouteCollection $collection: The route collection.
\Symfony\Component\HttpFoundation\Request $request: The request.
Return value
\Symfony\Component\Routing\RouteCollection The filtered/sorted route collection.
1 call to Router::applyRouteFilters()
- Router::matchRequest in core/
lib/ Drupal/ Core/ Routing/ Router.php
File
-
core/
lib/ Drupal/ Core/ Routing/ Router.php, line 276
Class
- Router
- Router implementation in Drupal.
Namespace
Drupal\Core\RoutingCode
protected function applyRouteFilters(RouteCollection $collection, Request $request) {
// Route filters are expected to throw an exception themselves if they
// end up filtering the list down to 0.
foreach ($this->filters as $filter) {
$collection = $filter->filter($collection, $request);
}
return $collection;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.