File tree 1 file changed +9
-3
lines changed
cookbook/event_dispatcher
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -113,9 +113,15 @@ Creating an Event Subscriber
113
113
----------------------------
114
114
115
115
Another way to listen to events is via an **event subscriber **, which is a class
116
- that can define one or more methods that listen to one or various events. The
117
- event priority can be defined for each method (the higher the priority, the earlier
118
- the method is called). To learn more about event subscribers, read :doc: `/components/event_dispatcher/introduction `.
116
+ that defines one or more methods that listen to one or various events. The main
117
+ difference with the event listeners is that subscribers always know which events
118
+ they are listening to.
119
+
120
+ In a given subscriber, different methods can listen to the same event. The order
121
+ in which methods are executed is defined by the ``priority `` parameter of each
122
+ method (the higher the priority, the earlier the method is called). To learn more
123
+ about event subscribers, read :doc: `/components/event_dispatcher/introduction `.
124
+
119
125
The following example shows an event subscriber that defines several methods which
120
126
listen to the same ``kernel.exception `` event::
121
127
You can’t perform that action at this time.
0 commit comments