W3cubDocs

/Drupal 8

protected function DefaultExceptionHtmlSubscriber::getHandledFormats

protected DefaultExceptionHtmlSubscriber::getHandledFormats()

Specifies the request formats this subscriber will respond to.

Return value

array An indexed array of the format machine names that this subscriber will attempt to process, such as "html" or "json". Returning an empty array will apply to all formats.

Overrides HttpExceptionSubscriberBase::getHandledFormats

See also

\Symfony\Component\HttpFoundation\Request

File

core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php, line 78

Class

DefaultExceptionHtmlSubscriber
Exception subscriber for handling core default HTML error pages.

Namespace

Drupal\Core\EventSubscriber

Code

protected function getHandledFormats() {
  return ['html'];
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!EventSubscriber!DefaultExceptionHtmlSubscriber.php/function/DefaultExceptionHtmlSubscriber::getHandledFormats/8.1.x