Documentation

FilterControllerEvent extends KernelEvent
in package

Allows filtering of a controller callable.

You can call getController() to retrieve the current controller. With setController() you can set a new controller that is used in the processing of the request.

Controllers should be callables.

Tags
author

Bernhard Schussek bschussek@gmail.com

Table of Contents

$controller  : mixed
$kernel  : mixed
$propagationStopped  : bool
$request  : mixed
$requestType  : mixed
__construct()  : mixed
getController()  : callable
Returns the current controller.
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.
isMasterRequest()  : bool
Checks if this is a master request.
isPropagationStopped()  : bool
Returns whether further event listeners should be triggered.
setController()  : mixed
stopPropagation()  : mixed
Stops the propagation of the event to further event listeners.

Properties

$propagationStopped

private bool $propagationStopped = false

Whether no further event listeners should be triggered

Methods

__construct()

public __construct(HttpKernelInterface $kernel, callable $controller, Request $request, mixed $requestType) : mixed
Parameters
$kernel : HttpKernelInterface

The kernel in which this event was thrown

$controller : callable
$request : Request

The request the kernel is currently processing

$requestType : mixed

The request type the kernel is currently processing; one of HttpKernelInterface::MASTER_REQUEST or HttpKernelInterface::SUB_REQUEST

Return values
mixed

getController()

Returns the current controller.

public getController() : callable
Return values
callable

getRequest()

Returns the request the kernel is currently processing.

public getRequest() : Request
Return values
Request

getRequestType()

Returns the request type the kernel is currently processing.

public getRequestType() : int
Return values
int

One of HttpKernelInterface::MASTER_REQUEST and HttpKernelInterface::SUB_REQUEST

isMasterRequest()

Checks if this is a master request.

public isMasterRequest() : bool
Return values
bool

True if the request is a master request

isPropagationStopped()

Returns whether further event listeners should be triggered.

public isPropagationStopped() : bool
Tags
see
Event::stopPropagation()
Return values
bool

Whether propagation was already stopped for this event

setController()

public setController(callable $controller) : mixed
Parameters
$controller : callable
Return values
mixed

stopPropagation()

Stops the propagation of the event to further event listeners.

public stopPropagation() : mixed

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

Return values
mixed

Search results