Skip to content

Commit aad2b89

Browse files
committed
Missing reference docs for kernel.finish_request event
1 parent 8966d40 commit aad2b89

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

reference/events.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,35 @@ Listener Class Name
158158
:class:`Symfony\\Component\\HttpKernel\\EventListener\\StreamedResponseListener` -1024
159159
=================================================================================== ========
160160

161+
``kernel.finish_request``
162+
~~~~~~~~~~~~~~~~~~~~~~~~~
163+
164+
**Event Class**: :class:`Symfony\\Component\\HttpKernel\\Event\\FinishRequestEvent`
165+
166+
The purpose of this event is to allow you to reset the global and environmental state of
167+
the application after a sub-request has finished::
168+
169+
public function onKernelFinishRequest(FinishRequestEvent $event)
170+
{
171+
if (null === $parentRequest = $this->requestStack->getParentRequest()) {
172+
return;
173+
}
174+
175+
//Reset the locale of the subrequest to the locale of the parent request
176+
$this->setLocale($parentRequest);
177+
}
178+
179+
These are the built-in Symfony listeners related to this event:
180+
181+
========================================================================== ========
182+
Listener Class Name Priority
183+
========================================================================== ========
184+
:class:`Symfony\\Component\\HttpKernel\\EventListener\\LocaleListener` 0
185+
:class:`Symfony\\Component\\HttpKernel\\EventListener\\TranslatorListener` 0
186+
:class:`Symfony\\Component\\HttpKernel\\EventListener\\RouterListener` 0
187+
:class:`Symfony\\Component\\Security\\Http\\Firewall` 0
188+
========================================================================== ========
189+
161190
``kernel.terminate``
162191
~~~~~~~~~~~~~~~~~~~~
163192

0 commit comments

Comments
 (0)