@@ -64,7 +64,8 @@ The most common way to listen to an event is to register an **event listener**::
64
64
65
65
Each event receives a slightly different type of ``$event `` object. For
66
66
the ``kernel.exception `` event, it is :class: `Symfony\\ Component\\ HttpKernel\\ Event\\ GetResponseForExceptionEvent `.
67
- To see what type of object each event listener receives, see :class: `Symfony\\ Component\\ HttpKernel\\ KernelEvents `.
67
+ To see what type of object each event listener receives, see :class: `Symfony\\ Component\\ HttpKernel\\ KernelEvents `
68
+ or the documentation about the specific even you're listening to.
68
69
69
70
Now that the class is created, you just need to register it as a service and
70
71
notify Symfony that it is a "listener" on the ``kernel.exception `` event by
@@ -220,9 +221,9 @@ Request Events, Checking Types
220
221
------------------------------
221
222
222
223
A single page can make several requests (one master request, and then multiple
223
- sub-requests), which is why when working with the `` KernelEvents::REQUEST ``
224
- event , you might need to check the type of the request. This can be easily
225
- done as follow: :
224
+ sub-requests - typically by :ref: ` templating-embedding-controller `). For the core
225
+ Symfony events , you might need to check to see if the event is for a "master" request
226
+ or a "sub request" :
226
227
227
228
// src/AppBundle/EventListener/RequestListener.php
228
229
namespace AppBundle\E ventListener;
@@ -244,11 +245,8 @@ done as follow::
244
245
}
245
246
}
246
247
247
- .. tip ::
248
-
249
- Two types of request are available in the :class: `Symfony\\ Component\\ HttpKernel\\ HttpKernelInterface `
250
- interface: ``HttpKernelInterface::MASTER_REQUEST `` and
251
- ``HttpKernelInterface::SUB_REQUEST ``.
248
+ Certain things, like checking information on the *real * request, may not need to
249
+ be done on the sub-request listeners.
252
250
253
251
Events or Subscribers
254
252
---------------------
0 commit comments