function ClientErrorResponseSubscriber::getSubscribedEvents

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

File

core/lib/Drupal/Core/EventSubscriber/ClientErrorResponseSubscriber.php, line 42

Class

ClientErrorResponseSubscriber
Response subscriber to set the '4xx-response' cache tag on 4xx responses.

Namespace

Drupal\Core\EventSubscriber

Code

public static function getSubscribedEvents() {
    // Priority 10, so that it runs before FinishResponseSubscriber, which will
    // expose the cacheability metadata in the form of headers.
    $events[KernelEvents::RESPONSE][] = [
        'onRespond',
        10,
    ];
    return $events;
}

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