interface FilterInterface

Same name in this branch
  1. 9 core/modules/filter/src/Plugin/FilterInterface.php \Drupal\filter\Plugin\FilterInterface
Same name in other branches
  1. 8.9.x core/modules/filter/src/Plugin/FilterInterface.php \Drupal\filter\Plugin\FilterInterface
  2. 8.9.x core/lib/Drupal/Core/Routing/FilterInterface.php \Drupal\Core\Routing\FilterInterface
  3. 10 core/modules/filter/src/Plugin/FilterInterface.php \Drupal\filter\Plugin\FilterInterface
  4. 10 core/lib/Drupal/Core/Routing/FilterInterface.php \Drupal\Core\Routing\FilterInterface
  5. 11.x core/modules/filter/src/Plugin/FilterInterface.php \Drupal\filter\Plugin\FilterInterface
  6. 11.x core/lib/Drupal/Core/Routing/FilterInterface.php \Drupal\Core\Routing\FilterInterface

A route filter service to filter down the collection of route instances.

Hierarchy

Expanded class hierarchy of FilterInterface

All classes that implement FilterInterface

2 files declare their use of FilterInterface
AcceptHeaderMatcher.php in core/modules/system/tests/modules/accept_header_routing_test/src/Routing/AcceptHeaderMatcher.php
ReadOnlyModeMethodFilter.php in core/modules/jsonapi/src/Routing/ReadOnlyModeMethodFilter.php

File

core/lib/Drupal/Core/Routing/FilterInterface.php, line 11

Namespace

Drupal\Core\Routing
View source
interface FilterInterface {
    
    /**
     * Filters the route collection against a request.
     *
     * @param \Symfony\Component\Routing\RouteCollection $collection
     *   The collection against which to match.
     * @param \Symfony\Component\HttpFoundation\Request $request
     *   A Request object against which to match.
     *
     * @return \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.
     */
    public function filter(RouteCollection $collection, Request $request);

}

Members

Title Sort descending Modifiers Object type Summary Overrides
FilterInterface::filter public function Filters the route collection against a request. 5

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.