Skip to content

Commit

Permalink
Missing reference docs for kernel.finish_request event
Browse files Browse the repository at this point in the history
  • Loading branch information
acrobat committed Jan 28, 2016
1 parent 8966d40 commit fcb8899
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions reference/events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,35 @@ Listener Class Name
:class:`Symfony\\Component\\HttpKernel\\EventListener\\StreamedResponseListener` -1024
=================================================================================== ========

``kernel.finish_request``
~~~~~~~~~~~~~~~~~~~~~~~~~

**Event Class**: :class:`Symfony\\Component\\HttpKernel\\Event\\FinishRequestEvent`

The purpose of this event is to allow you to reset the global and environmental state of
the application after a sub-request has finished::

public function onKernelFinishRequest(FinishRequestEvent $event)
{
if (null === $parentRequest = $this->requestStack->getParentRequest()) {
return;
}

//Reset the locale of the subrequest to the locale of the parent request
$this->setLocale($parentRequest);
}

These are the built-in Symfony listeners related to this event:

========================================================================== ========
Listener Class Name Priority
========================================================================== ========
:class:`Symfony\\Component\\HttpKernel\\EventListener\\LocaleListener` 0
:class:`Symfony\\Component\\HttpKernel\\EventListener\\TranslatorListener` 0
:class:`Symfony\\Component\\HttpKernel\\EventListener\\RouterListener` 0
:class:`Symfony\\Component\\Security\\Http\\Firewall` 0
========================================================================== ========

``kernel.terminate``
~~~~~~~~~~~~~~~~~~~~

Expand Down

0 comments on commit fcb8899

Please sign in to comment.