@@ -28,7 +28,7 @@ following information:
28
28
``kernel.request ``
29
29
~~~~~~~~~~~~~~~~~~
30
30
31
- **Event Class **: :class: `Symfony\\ Component\\ HttpKernel\\ Event\\ GetResponseEvent `
31
+ **Event Class **: :class: `Symfony\\ Component\\ HttpKernel\\ Event\\ RequestEvent `
32
32
33
33
This event is dispatched very early in Symfony, before the controller is
34
34
determined. It's useful to add information to the Request or return a Response
@@ -48,16 +48,16 @@ their priorities:
48
48
``kernel.controller ``
49
49
~~~~~~~~~~~~~~~~~~~~~
50
50
51
- **Event Class **: :class: `Symfony\\ Component\\ HttpKernel\\ Event\\ FilterControllerEvent `
51
+ **Event Class **: :class: `Symfony\\ Component\\ HttpKernel\\ Event\\ ControllerEvent `
52
52
53
53
This event is dispatched after the controller to be executed has been resolved
54
54
but before executing it. It's useful to initialize things later needed by the
55
55
controller, such as `param converters `_, and even to change the controller
56
56
entirely::
57
57
58
- use Symfony\Component\HttpKernel\Event\FilterControllerEvent ;
58
+ use Symfony\Component\HttpKernel\Event\ControllerEvent ;
59
59
60
- public function onKernelController(FilterControllerEvent $event)
60
+ public function onKernelController(ControllerEvent $event)
61
61
{
62
62
// ...
63
63
@@ -79,15 +79,15 @@ their priorities:
79
79
``kernel.controller_arguments ``
80
80
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
81
81
82
- **Event Class **: :class: `Symfony\\ Component\\ HttpKernel\\ Event\\ FilterControllerArgumentsEvent `
82
+ **Event Class **: :class: `Symfony\\ Component\\ HttpKernel\\ Event\\ ControllerArgumentsEvent `
83
83
84
84
This event is dispatched just before a controller is called. It's useful to
85
85
configure the arguments that are going to be passed to the controller.
86
86
Typically, this is used to map URL routing parameters to their corresponding
87
87
named arguments; or pass the current request when the ``Request `` type-hint is
88
88
found::
89
89
90
- public function onKernelControllerArguments(FilterControllerArgumentsEvent $event)
90
+ public function onKernelControllerArguments(ControllerArgumentsEvent $event)
91
91
{
92
92
// ...
93
93
@@ -109,17 +109,17 @@ their priorities:
109
109
``kernel.view ``
110
110
~~~~~~~~~~~~~~~
111
111
112
- **Event Class **: :class: `Symfony\\ Component\\ HttpKernel\\ Event\\ GetResponseForControllerResultEvent `
112
+ **Event Class **: :class: `Symfony\\ Component\\ HttpKernel\\ Event\\ ViewEvent `
113
113
114
114
This event is dispatched after the controller has been executed but *only * if
115
115
the controller does *not * return a :class: `Symfony\\ Component\\ HttpFoundation\\ Response `
116
116
object. It's useful to transform the returned value (e.g. a string with some
117
117
HTML contents) into the ``Response `` object needed by Symfony::
118
118
119
119
use Symfony\Component\HttpFoundation\Response;
120
- use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent ;
120
+ use Symfony\Component\HttpKernel\Event\ViewEvent ;
121
121
122
- public function onKernelView(GetResponseForControllerResultEvent $event)
122
+ public function onKernelView(ViewEvent $event)
123
123
{
124
124
$value = $event->getControllerResult();
125
125
$response = new Response();
@@ -143,13 +143,13 @@ their priorities:
143
143
``kernel.response ``
144
144
~~~~~~~~~~~~~~~~~~~
145
145
146
- **Event Class **: :class: `Symfony\\ Component\\ HttpKernel\\ Event\\ FilterResponseEvent `
146
+ **Event Class **: :class: `Symfony\\ Component\\ HttpKernel\\ Event\\ ResponseEvent `
147
147
148
148
This event is dispatched after the controller or any ``kernel.view `` listener
149
149
returns a ``Response `` object. It's useful to modify or replace the response
150
150
before sending it back (e.g. add/modify HTTP headers, add cookies, etc.)::
151
151
152
- public function onKernelResponse(FilterResponseEvent $event)
152
+ public function onKernelResponse(ResponseEvent $event)
153
153
{
154
154
$response = $event->getResponse();
155
155
@@ -196,7 +196,7 @@ their priorities:
196
196
``kernel.terminate ``
197
197
~~~~~~~~~~~~~~~~~~~~
198
198
199
- **Event Class **: :class: `Symfony\\ Component\\ HttpKernel\\ Event\\ PostResponseEvent `
199
+ **Event Class **: :class: `Symfony\\ Component\\ HttpKernel\\ Event\\ TerminateEvent `
200
200
201
201
This event is dispatched after the response has been sent (after the execution
202
202
of the :method: `Symfony\\ Component\\ HttpKernel\\ HttpKernel::handle ` method).
@@ -219,16 +219,16 @@ their priorities:
219
219
``kernel.exception ``
220
220
~~~~~~~~~~~~~~~~~~~~
221
221
222
- **Event Class **: :class: `Symfony\\ Component\\ HttpKernel\\ Event\\ GetResponseForExceptionEvent `
222
+ **Event Class **: :class: `Symfony\\ Component\\ HttpKernel\\ Event\\ ExceptionEvent `
223
223
224
224
This event is dispatched as soon as an error occurs during the handling of the
225
225
HTTP request. It's useful to recover from errors or modify the exception details
226
226
sent as response::
227
227
228
228
use Symfony\Component\HttpFoundation\Response;
229
- use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent ;
229
+ use Symfony\Component\HttpKernel\Event\ExceptionEvent ;
230
230
231
- public function onKernelException(GetResponseForExceptionEvent $event)
231
+ public function onKernelException(ExceptionEvent $event)
232
232
{
233
233
$exception = $event->getException();
234
234
$response = new Response();
@@ -265,7 +265,7 @@ response:
265
265
266
266
If you want to overwrite the status code of the exception response, which
267
267
you should not without a good reason, call
268
- ``GetResponseForExceptionEvent ::allowCustomResponseCode() `` first and then
268
+ ``ExceptionEvent ::allowCustomResponseCode() `` first and then
269
269
set the status code on the response::
270
270
271
271
$event->allowCustomResponseCode();
0 commit comments