Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf712586

Browse files
committed
bug#5297 Kernel Events Proofreading after#4901 (weaverryan)
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/aHi 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 literalscd820d7 Proofreading after#4901
2 parents41bf9d2 +c7326da commitf712586

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

‎cookbook/profiler/profiling_data.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ this token is available in the ``X-Debug-Token`` HTTP header of the response.
2020
Using this token, you can access the profile of any past response thanks to the
2121
:method:`Symfony\\Component\\HttpKernel\\Profiler\\Profiler::loadProfile` method::
2222

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

2626
..tip::

‎reference/dic_tags.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,9 @@ cookbook entry.
549549
For another practical example of a kernel listener, see the cookbook
550550
article::doc:`/cookbook/request/mime_type`.
551551

552+
Core Event Listener Reference
553+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
554+
552555
For the reference of Event Listeners associated with each kernel event, see the
553556
:doc:`Symfony Events Reference</reference/events>`.
554557

‎reference/events.rst

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Symfony Framework Events
22
========================
33

4+
When the Symfony Framework (or anything using the:class:`Symfony\\Component\\HttpKernel\\HttpKernel`)
5+
handles a request, a few core events are dispatched so that you can add listeners
6+
throughout the process. These are called the "kernel events". For a larger
7+
explanation, see:doc:`/components/http_kernel/introduction`.
8+
49
Kernel Events
510
-------------
611

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

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

28-
The goal of this event is to either return a ``Response`` object immediately
29-
or setup variables so that a Controller can be called after the event. Any
30-
listener can return a ``Response`` object via the ``setResponse()`` method on
31-
the event. In this case, all other listeners won't be called.
32-
33-
This event is used by the FrameworkBundle to populate the ``_controller``
34-
``Request`` attribute, via the
35-
:class:`Symfony\\Bundle\\FrameworkBundle\\EventListener\\RouterListener`.
36-
RequestListener uses a:class:`Symfony\\Component\\Routing\\RouterInterface`
37-
object to match the ``Request`` and determine the Controller name (stored in the
38-
``_controller`` ``Request`` attribute).
33+
This event is dispatched very early in Symfony, before the controller is
34+
determined.
3935

4036
..seealso::
4137

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

222-
return new Response(
218+
$response = Response(
223219
'Error',
224220
404 // ignored,
225221
array('X-Status-Code' => 200)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp