A RouteFilter takes a RouteCollection and returns a filtered subset.
It is not implemented as a filter iterator because we want to allow router filters to handle their own empty-case handling, usually by throwing an appropriate exception if no routes match the object's rules.
@author Larry Garfield @author David Buchmann
Expanded class hierarchy of RouteFilterInterface
All classes that implement RouteFilterInterface
interface RouteFilterInterface {
/**
* Filters the route collection against a request and returns all matching
* routes.
*
* @param RouteCollection $collection The collection against which to match.
* @param Request $request A Request object against which to match.
*
* @return RouteCollection A non-empty RouteCollection of matched routes.
*
* @throws 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);
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RouteFilterInterface:: |
public | function | Filters the route collection against a request and returns all matching routes. | 1 |