RequestListener

This class set custom actions on events listeners
author Damien Jarry
version 1.0
uses ExternalTrackingManager
uses GetResponseEvent
uses FilterControllerEvent
uses FilterResponseEvent
uses GetResponseForControllerResultEvent

 Methods

Constructor Store some variables on the current instance

__construct(\GeekyHouse\ExternalTrackingBundle\Service\ExternalTrackingManager $ExternalTrackingManager) : \GeekyHouse\ExternalTrackingBundle\EventListener\RequestListener

Parameters

$ExternalTrackingManager

\GeekyHouse\ExternalTrackingBundle\Service\ExternalTrackingManager

A ExternalTrackingManager instance

Returns

\GeekyHouse\ExternalTrackingBundle\EventListener\RequestListenerA RequestListener instance

Returns an array of event names this subscriber wants to listen to.

getSubscribedEvents() : array
Static
The array keys are event names and the value can be: * The method name to call (priority defaults to 0) * An array composed of the method name to call and the priority * An array of arrays composed of the method names to call and respective priorities, or 0 if unset For instance: * array('eventName' => 'methodName') * array('eventName' => array('methodName', $priority)) * array('eventName' => array(array('methodName1', $priority), array('methodName2'))

Returns

arrayThe event names to listen to

Allows filtering of a controller callable You can call getController() to retrieve the current controller.

onKernelController(\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) 
With setController() you can set a new controller that is used in the processing of the request. Controllers should be callables.

Parameters

$event

\Symfony\Component\HttpKernel\Event\FilterControllerEvent

A FilterControllerEvent instance

Allows to create a response for a request Call setResponse() to set the response that will be returned for the current request.

onKernelRequest(\Symfony\Component\HttpKernel\Event\GetResponseEvent $event) 
The propagation of this event is stopped as soon as a response is set.

Parameters

$event

\Symfony\Component\HttpKernel\Event\GetResponseEvent

A GetResponseEvent instance

Allows to filter a Response object You can call getResponse() to retrieve the current response.

onKernelResponse(\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) 
With setResponse() you can set a new response that will be returned to the browser.

Parameters

$event

\Symfony\Component\HttpKernel\Event\FilterResponseEvent

A FilterResponseEvent instance

Allows to create a response for the return value of a controller Call setResponse() to set the response that will be returned for the current request.

onKernelView(\Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent $event) 
The propagation of this event is stopped as soon as a response is set.

Parameters

$event

\Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent

A GetResponseForControllerResultEvent instance

 Properties

 

An ExternalTrackingManager instance

$ExternalTrackingManager : \GeekyHouse\ExternalTrackingBundle\Service\ExternalTrackingManager

Default