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

Breadcrumb

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

class KernelEvents

Contains all events thrown in the HttpKernel component.

@author Bernhard Schussek <bschussek@gmail.com>

Hierarchy

  • class \Symfony\Component\HttpKernel\KernelEvents

Expanded class hierarchy of KernelEvents

65 files declare their use of KernelEvents
AbstractSessionListener.php in vendor/symfony/http-kernel/EventListener/AbstractSessionListener.php
ActiveLinkResponseFilter.php in core/lib/Drupal/Core/EventSubscriber/ActiveLinkResponseFilter.php
AddRequestFormatsListener.php in vendor/symfony/http-kernel/EventListener/AddRequestFormatsListener.php
AjaxResponseSubscriber.php in core/lib/Drupal/Core/EventSubscriber/AjaxResponseSubscriber.php
AnonymousUserResponseSubscriber.php in core/lib/Drupal/Core/EventSubscriber/AnonymousUserResponseSubscriber.php

... See full list

File

vendor/symfony/http-kernel/KernelEvents.php, line 28

Namespace

Symfony\Component\HttpKernel
View source
final class KernelEvents {
    
    /**
     * The REQUEST event occurs at the very beginning of request
     * dispatching.
     *
     * This event allows you to create a response for a request before any
     * other code in the framework is executed.
     *
     * @Event("Symfony\Component\HttpKernel\Event\RequestEvent")
     */
    public const REQUEST = 'kernel.request';
    
    /**
     * The EXCEPTION event occurs when an uncaught exception appears.
     *
     * This event allows you to create a response for a thrown exception or
     * to modify the thrown exception.
     *
     * @Event("Symfony\Component\HttpKernel\Event\ExceptionEvent")
     */
    public const EXCEPTION = 'kernel.exception';
    
    /**
     * The CONTROLLER event occurs once a controller was found for
     * handling a request.
     *
     * This event allows you to change the controller that will handle the
     * request.
     *
     * @Event("Symfony\Component\HttpKernel\Event\ControllerEvent")
     */
    public const CONTROLLER = 'kernel.controller';
    
    /**
     * The CONTROLLER_ARGUMENTS event occurs once controller arguments have been resolved.
     *
     * This event allows you to change the arguments that will be passed to
     * the controller.
     *
     * @Event("Symfony\Component\HttpKernel\Event\ControllerArgumentsEvent")
     */
    public const CONTROLLER_ARGUMENTS = 'kernel.controller_arguments';
    
    /**
     * The VIEW event occurs when the return value of a controller
     * is not a Response instance.
     *
     * This event allows you to create a response for the return value of the
     * controller.
     *
     * @Event("Symfony\Component\HttpKernel\Event\ViewEvent")
     */
    public const VIEW = 'kernel.view';
    
    /**
     * The RESPONSE event occurs once a response was created for
     * replying to a request.
     *
     * This event allows you to modify or replace the response that will be
     * replied.
     *
     * @Event("Symfony\Component\HttpKernel\Event\ResponseEvent")
     */
    public const RESPONSE = 'kernel.response';
    
    /**
     * The FINISH_REQUEST event occurs when a response was generated for a request.
     *
     * This event allows you to reset the global and environmental state of
     * the application, when it was changed during the request.
     *
     * @Event("Symfony\Component\HttpKernel\Event\FinishRequestEvent")
     */
    public const FINISH_REQUEST = 'kernel.finish_request';
    
    /**
     * The TERMINATE event occurs once a response was sent.
     *
     * This event allows you to run expensive post-response jobs.
     *
     * @Event("Symfony\Component\HttpKernel\Event\TerminateEvent")
     */
    public const TERMINATE = 'kernel.terminate';
    
    /**
     * Event aliases.
     *
     * These aliases can be consumed by RegisterListenersPass.
     */
    public const ALIASES = [
        ControllerArgumentsEvent::class => self::CONTROLLER_ARGUMENTS,
        ControllerEvent::class => self::CONTROLLER,
        ResponseEvent::class => self::RESPONSE,
        FinishRequestEvent::class => self::FINISH_REQUEST,
        RequestEvent::class => self::REQUEST,
        ViewEvent::class => self::VIEW,
        ExceptionEvent::class => self::EXCEPTION,
        TerminateEvent::class => self::TERMINATE,
    ];

}

Members

Title Sort descending Modifiers Object type Summary
KernelEvents::ALIASES public constant Event aliases.
KernelEvents::CONTROLLER public constant The CONTROLLER event occurs once a controller was found for
handling a request.
KernelEvents::CONTROLLER_ARGUMENTS public constant The CONTROLLER_ARGUMENTS event occurs once controller arguments have been resolved.
KernelEvents::EXCEPTION public constant The EXCEPTION event occurs when an uncaught exception appears.
KernelEvents::FINISH_REQUEST public constant The FINISH_REQUEST event occurs when a response was generated for a request.
KernelEvents::REQUEST public constant The REQUEST event occurs at the very beginning of request
dispatching.
KernelEvents::RESPONSE public constant The RESPONSE event occurs once a response was created for
replying to a request.
KernelEvents::TERMINATE public constant The TERMINATE event occurs once a response was sent.
KernelEvents::VIEW public constant The VIEW event occurs when the return value of a controller
is not a Response instance.
RSS feed
Powered by Drupal