function 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;
}

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