Skip to content

Commit

Permalink
bug #5297 Kernel Events Proofreading after #4901 (weaverryan)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.3 branch.

Discussion
----------

Kernel Events Proofreading after #4901

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | 2.3+
| Fixed tickets | n/a

Hi guys!

This is a proofread of #4901. I removed the ticks in the titles - iirc, the ticks don't work in titles. I also fixed a few minor bugs I believe.

Thanks!

Commits
-------

c7326da another fix!
106bda9 re-adding literals
cd820d7 Proofreading after #4901
  • Loading branch information
weaverryan committed May 23, 2015
2 parents 41bf9d2 + c7326da commit f712586
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion cookbook/profiler/profiling_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ this token is available in the ``X-Debug-Token`` HTTP header of the response.
Using this token, you can access the profile of any past response thanks to the
:method:`Symfony\\Component\\HttpKernel\\Profiler\\Profiler::loadProfile` method::

$token = $request->headers->get('X-Debug-Token');
$token = $response->headers->get('X-Debug-Token');
$profile = $container->get('profiler')->loadProfile($token);

.. tip::
Expand Down
3 changes: 3 additions & 0 deletions reference/dic_tags.rst
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,9 @@ cookbook entry.
For another practical example of a kernel listener, see the cookbook
article: :doc:`/cookbook/request/mime_type`.

Core Event Listener Reference
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

For the reference of Event Listeners associated with each kernel event, see the
:doc:`Symfony Events Reference </reference/events>`.

Expand Down
20 changes: 8 additions & 12 deletions reference/events.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Symfony Framework Events
========================

When the Symfony Framework (or anything using the :class:`Symfony\\Component\\HttpKernel\\HttpKernel`)
handles a request, a few core events are dispatched so that you can add listeners
throughout the process. These are called the "kernel events". For a larger
explanation, see :doc:`/components/http_kernel/introduction`.

Kernel Events
-------------

Expand All @@ -25,17 +30,8 @@ each event has access to the following information:

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

The goal of this event is to either return a ``Response`` object immediately
or setup variables so that a Controller can be called after the event. Any
listener can return a ``Response`` object via the ``setResponse()`` method on
the event. In this case, all other listeners won't be called.

This event is used by the FrameworkBundle to populate the ``_controller``
``Request`` attribute, via the
:class:`Symfony\\Bundle\\FrameworkBundle\\EventListener\\RouterListener`.
RequestListener uses a :class:`Symfony\\Component\\Routing\\RouterInterface`
object to match the ``Request`` and determine the Controller name (stored in the
``_controller`` ``Request`` attribute).
This event is dispatched very early in Symfony, before the controller is
determined.

.. seealso::

Expand Down Expand Up @@ -219,7 +215,7 @@ and set a new ``Exception`` object, or do nothing::
response won't work. If you want to overwrite the status code (which you
should not without a good reason), set the ``X-Status-Code`` header::

return new Response(
$response = Response(
'Error',
404 // ignored,
array('X-Status-Code' => 200)
Expand Down

0 comments on commit f712586

Please sign in to comment.