public function CustomPageExceptionHtmlSubscriber::on403

public CustomPageExceptionHtmlSubscriber::on403(GetResponseForExceptionEvent $event)

Handles a 403 error for HTML.

Parameters

\Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent $event: The event to process.

Overrides DefaultExceptionHtmlSubscriber::on403

File

core/lib/Drupal/Core/EventSubscriber/CustomPageExceptionHtmlSubscriber.php, line 68

Class

CustomPageExceptionHtmlSubscriber
Exception subscriber for handling core custom HTML error pages.

Namespace

Drupal\Core\EventSubscriber

Code

public function on403(GetResponseForExceptionEvent $event) {
  $custom_403_path = $this->configFactory->get('system.site')->get('page.403');
  if (!empty($custom_403_path)) {
    $this->makeSubrequestToCustomPath($event, $custom_403_path, Response::HTTP_FORBIDDEN);
  }
}

© 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!CustomPageExceptionHtmlSubscriber.php/function/CustomPageExceptionHtmlSubscriber::on403/8.1.x