class RouteFilterSubscriber in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/lib/Drupal/Core/EventSubscriber/RouteFilterSubscriber.php \Drupal\Core\EventSubscriber\RouteFilterSubscriber
Listens to the filtered collection of route instances.
Hierarchy
- class \Drupal\Core\EventSubscriber\RouteFilterSubscriber implements EventSubscriberInterface
Expanded class hierarchy of RouteFilterSubscriber
1 string reference to 'RouteFilterSubscriber'
- core.services.yml in core/
core.services.yml - core/core.services.yml
1 service uses RouteFilterSubscriber
File
- core/
lib/ Drupal/ Core/ EventSubscriber/ RouteFilterSubscriber.php, line 18 - Contains \Drupal\Core\EventSubscriber\RouteFilterSubscriber.
Namespace
Drupal\Core\EventSubscriberView source
class RouteFilterSubscriber implements EventSubscriberInterface {
/**
* The lazy route filter.
*
* @var \Drupal\Core\Routing\LazyRouteFilter
*/
protected $routeFilter;
/**
* Constructs the RouteFilterSubscriber object.
*
* @param \Drupal\Core\Routing\LazyRouteFilter $route_filter
* The lazy route filter.
*/
public function __construct(LazyRouteFilter $route_filter) {
$this->routeFilter = $route_filter;
}
/**
* Get the Response object from filtered route collection.
*
* @param \Drupal\Core\Routing\RouteBuildEvent $event
* The route build event.
*/
public function onRouteAlter(RouteBuildEvent $event) {
$this->routeFilter
->setFilters($event
->getRouteCollection());
}
/**
* {@inheritdoc}
*/
static function getSubscribedEvents() {
$events[RoutingEvents::ALTER][] = array(
'onRouteAlter',
-300,
);
return $events;
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RouteFilterSubscriber:: |
protected | property | The lazy route filter. | |
RouteFilterSubscriber:: |
static | function |
Returns an array of event names this subscriber wants to listen to. Overrides EventSubscriberInterface:: |
|
RouteFilterSubscriber:: |
public | function | Get the Response object from filtered route collection. | |
RouteFilterSubscriber:: |
public | function | Constructs the RouteFilterSubscriber object. |