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