function FilterInterface::filter
Same name in other branches
- 9 core/lib/Drupal/Core/Routing/FilterInterface.php \Drupal\Core\Routing\FilterInterface::filter()
- 10 core/lib/Drupal/Core/Routing/FilterInterface.php \Drupal\Core\Routing\FilterInterface::filter()
Filters the route collection against a request.
Parameters
\Symfony\Component\Routing\RouteCollection $collection: The collection against which to match.
\Symfony\Component\HttpFoundation\Request $request: A Request object against which to match.
Return value
\Symfony\Component\Routing\RouteCollection A non-empty RouteCollection of matched routes
Throws
\Symfony\Component\Routing\Exception\ResourceNotFoundException If none of the routes in $collection matches $request. This is a performance optimization to not continue the match process when a match will no longer be possible.
5 methods override FilterInterface::filter()
- AcceptHeaderMatcher::filter in core/
modules/ system/ tests/ modules/ accept_header_routing_test/ src/ Routing/ AcceptHeaderMatcher.php - Filters the route collection against a request.
- ContentTypeHeaderMatcher::filter in core/
lib/ Drupal/ Core/ Routing/ ContentTypeHeaderMatcher.php - Filters the route collection against a request.
- MethodFilter::filter in core/
lib/ Drupal/ Core/ Routing/ MethodFilter.php - Filters the route collection against a request.
- ReadOnlyModeMethodFilter::filter in core/
modules/ jsonapi/ src/ Routing/ ReadOnlyModeMethodFilter.php - Filters the route collection against a request.
- RequestFormatRouteFilter::filter in core/
lib/ Drupal/ Core/ Routing/ RequestFormatRouteFilter.php - Filters the route collection against a request.
File
-
core/
lib/ Drupal/ Core/ Routing/ FilterInterface.php, line 29
Class
- FilterInterface
- A route filter service to filter down the collection of route instances.
Namespace
Drupal\Core\RoutingCode
public function filter(RouteCollection $collection, Request $request);
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.