You are here

public static function AdminRouteSubscriber::getSubscribedEvents in Drupal 9

Same name and namespace in other branches
  1. 8 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;
}