function AdminRouteSubscriber::getSubscribedEvents

Same name in other branches
  1. 8.9.x core/modules/system/src/EventSubscriber/AdminRouteSubscriber.php \Drupal\system\EventSubscriber\AdminRouteSubscriber::getSubscribedEvents()
  2. 10 core/modules/system/src/EventSubscriber/AdminRouteSubscriber.php \Drupal\system\EventSubscriber\AdminRouteSubscriber::getSubscribedEvents()
  3. 11.x core/modules/system/src/EventSubscriber/AdminRouteSubscriber.php \Drupal\system\EventSubscriber\AdminRouteSubscriber::getSubscribedEvents()

Overrides RouteSubscriberBase::getSubscribedEvents

File

core/modules/system/src/EventSubscriber/AdminRouteSubscriber.php, line 30

Class

AdminRouteSubscriber
Adds the _admin_route option to each admin HTML route.

Namespace

Drupal\system\EventSubscriber

Code

public static function getSubscribedEvents() {
    $events = parent::getSubscribedEvents();
    // Use a lower priority than \Drupal\field_ui\Routing\RouteSubscriber or
    // \Drupal\views\EventSubscriber\RouteSubscriber to ensure we add the option
    // to their routes.
    $events[RoutingEvents::ALTER] = [
        'onAlterRoutes',
        -200,
    ];
    return $events;
}

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