Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. CustomPageExceptionHtmlSubscriber.php

function CustomPageExceptionHtmlSubscriber::on404

Overrides DefaultExceptionHtmlSubscriber::on404

File

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

Class

CustomPageExceptionHtmlSubscriber
Exception subscriber for handling core custom HTML error pages.

Namespace

Drupal\Core\EventSubscriber

Code

public function on404(ExceptionEvent $event) {
    $custom_404_path = $this->configFactory
        ->get('system.site')
        ->get('page.404');
    if (!empty($custom_404_path)) {
        $this->makeSubrequestToCustomPath($event, $custom_404_path, Response::HTTP_NOT_FOUND);
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal