You are here

public function RouteEnhancerSubscriber::onRouteAlter in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/EventSubscriber/RouteEnhancerSubscriber.php \Drupal\Core\EventSubscriber\RouteEnhancerSubscriber::onRouteAlter()

Adds the route_enhancer object to the route collection.

Parameters

\Drupal\Core\Routing\RouteBuildEvent $event: The route build event.

File

core/lib/Drupal/Core/EventSubscriber/RouteEnhancerSubscriber.php, line 41
Contains \Drupal\Core\EventSubscriber\RouteEnhancerSubscriber.

Class

RouteEnhancerSubscriber
Listens to the new routes before they get saved.

Namespace

Drupal\Core\EventSubscriber

Code

public function onRouteAlter(RouteBuildEvent $event) {
  $this->routeEnhancer
    ->setEnhancers($event
    ->getRouteCollection());
}