You are here

public function CustomPageExceptionHtmlSubscriber::on403 in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/EventSubscriber/CustomPageExceptionHtmlSubscriber.php \Drupal\Core\EventSubscriber\CustomPageExceptionHtmlSubscriber::on403()

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 67
Contains \Drupal\Core\EventSubscriber\CustomPageExceptionHtmlSubscriber.

Class

CustomPageExceptionHtmlSubscriber
Exception subscriber for handling core custom HTML error pages.

Namespace

Drupal\Core\EventSubscriber

Code

public function on403(GetResponseForExceptionEvent $event) {
  $path = $this->aliasManager
    ->getPathByAlias($this->configFactory
    ->get('system.site')
    ->get('page.403'));
  $this
    ->makeSubrequest($event, trim($path, '/'), Response::HTTP_FORBIDDEN);
}