You are here

public static function RenderArrayNonHtmlSubscriber::getSubscribedEvents in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/EventSubscriber/RenderArrayNonHtmlSubscriber.php \Drupal\Core\EventSubscriber\RenderArrayNonHtmlSubscriber::getSubscribedEvents()

File

core/lib/Drupal/Core/EventSubscriber/RenderArrayNonHtmlSubscriber.php, line 37

Class

RenderArrayNonHtmlSubscriber
Throws 406 if requesting non-HTML format and controller returns render array.

Namespace

Drupal\Core\EventSubscriber

Code

public static function getSubscribedEvents() {
  $events[KernelEvents::VIEW][] = [
    'onRespond',
    -10,
  ];
  return $events;
}