function RouteSubscriberBase::onAlterRoutes

Same name in other branches
  1. 9 core/lib/Drupal/Core/Routing/RouteSubscriberBase.php \Drupal\Core\Routing\RouteSubscriberBase::onAlterRoutes()
  2. 10 core/lib/Drupal/Core/Routing/RouteSubscriberBase.php \Drupal\Core\Routing\RouteSubscriberBase::onAlterRoutes()
  3. 11.x core/lib/Drupal/Core/Routing/RouteSubscriberBase.php \Drupal\Core\Routing\RouteSubscriberBase::onAlterRoutes()

Delegates the route altering to self::alterRoutes().

Parameters

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

1 method overrides RouteSubscriberBase::onAlterRoutes()
SpecialAttributesRouteSubscriber::onAlterRoutes in core/lib/Drupal/Core/EventSubscriber/SpecialAttributesRouteSubscriber.php
Delegates the route altering to self::alterRoutes().

File

core/lib/Drupal/Core/Routing/RouteSubscriberBase.php, line 35

Class

RouteSubscriberBase
Provides a base implementation for RouteSubscriber.

Namespace

Drupal\Core\Routing

Code

public function onAlterRoutes(RouteBuildEvent $event) {
    $collection = $event->getRouteCollection();
    $this->alterRoutes($collection);
}

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