function RouteMethodSubscriber::getSubscribedEvents

Same name in other branches
  1. 9 core/lib/Drupal/Core/EventSubscriber/RouteMethodSubscriber.php \Drupal\Core\EventSubscriber\RouteMethodSubscriber::getSubscribedEvents()
  2. 8.9.x core/lib/Drupal/Core/EventSubscriber/RouteMethodSubscriber.php \Drupal\Core\EventSubscriber\RouteMethodSubscriber::getSubscribedEvents()
  3. 10 core/lib/Drupal/Core/EventSubscriber/RouteMethodSubscriber.php \Drupal\Core\EventSubscriber\RouteMethodSubscriber::getSubscribedEvents()

File

core/lib/Drupal/Core/EventSubscriber/RouteMethodSubscriber.php, line 38

Class

RouteMethodSubscriber
Provides a default value for the HTTP method restriction on routes.

Namespace

Drupal\Core\EventSubscriber

Code

public static function getSubscribedEvents() : array {
    // Set a higher priority to ensure that routes get the default HTTP methods
    // as early as possible.
    $events[RoutingEvents::ALTER][] = [
        'onRouteBuilding',
        5000,
    ];
    return $events;
}

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