Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. RoutePreloader.php

function RoutePreloader::getSubscribedEvents

Overrides EventSubscriberInterface::getSubscribedEvents

File

core/lib/Drupal/Core/Routing/RoutePreloader.php, line 86

Class

RoutePreloader
Defines a class that can pre-load non-admin routes.

Namespace

Drupal\Core\Routing

Code

public static function getSubscribedEvents() : array {
    // Set a really low priority to catch as many as possible routes.
    $events[RoutingEvents::ALTER] = [
        'onAlterRoutes',
        -1024,
    ];
    $events[RoutingEvents::FINISHED] = [
        'onFinishedRoutes',
    ];
    // Load the routes before the controller is executed (which happens after
    // the kernel request event).
    $events[KernelEvents::REQUEST][] = [
        'onRequest',
    ];
    return $events;
}
RSS feed
Powered by Drupal