Documentation

TerminateEvent extends KernelEvent
in package

FinalYes

Allows to execute logic after a response was sent.

Since it's only triggered on main requests, the getRequestType() method will always return the value of HttpKernelInterface::MAIN_REQUEST.

Tags
author

Jordi Boggiano j.boggiano@seld.be

Table of Contents

Properties

$kernel  : mixed
$propagationStopped  : bool
$request  : mixed
$requestType  : int|null
$response  : mixed

Methods

__construct()  : mixed
getKernel()  : HttpKernelInterface
Returns the kernel in which this event was thrown.
getRequest()  : Request
Returns the request the kernel is currently processing.
getRequestType()  : int
Returns the request type the kernel is currently processing.
getResponse()  : Response
isMainRequest()  : bool
Checks if this is the main request.
isPropagationStopped()  : bool
Is propagation stopped?
stopPropagation()  : void
Stops the propagation of the event to further event listeners.

Properties

$propagationStopped

private bool $propagationStopped = false

Methods

getRequestType()

Returns the request type the kernel is currently processing.

public getRequestType() : int
Return values
int

One of HttpKernelInterface::MAIN_REQUEST and HttpKernelInterface::SUB_REQUEST

isMainRequest()

Checks if this is the main request.

public isMainRequest() : bool
Return values
bool

isPropagationStopped()

Is propagation stopped?

public isPropagationStopped() : bool
Return values
bool

True if the Event is complete and no further listeners should be called. False to continue calling listeners.

stopPropagation()

Stops the propagation of the event to further event listeners.

public stopPropagation() : void

If multiple event listeners are connected to the same event, no further event listener will be triggered once any trigger calls stopPropagation().


        
On this page

Search results