8000 Merge branch '3.4' into 4.3 · symfony/symfony-docs@9f57f19 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9f57f19

Browse files
committed
Merge branch '3.4' into 4.3
* 3.4: Tweak the explanation about event priorities
2 parents 97a33ae + 7f9d771 commit 9f57f19

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

event_dispatcher.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,12 @@ that defines one or more methods that listen to one or various events. The main
145145
difference with the event listeners is that subscribers always know which events
146146
they are listening to.
147147

148-
In a given subscriber, different methods can listen to the same event. The order
149-
in which methods are executed is defined by the ``priority`` parameter of each
150-
method (the higher the number the earlier the method is called). To learn more
151-
about event subscribers, read :doc:`/components/event_dispatcher`.
148+
If different event subscriber methods listen to the same event, their order is
149+
defined by the ``priority`` parameter. This value is a positive or negative
150+
integer which defaults to ``0``. The higher the number, the earlier the method
151+
is called. **Priority is aggregated for all listeners and subscribers**, so your
152+
methods could be executed before or after the methods defined in other listeners
153+
and subscribers. To learn more about event subscribers, read :doc:`/components/event_dispatcher`.
152154

153155
The following example shows an event subscriber that defines several methods which
154156
listen to the same ``kernel.exception`` event::

0 commit comments

Comments
 (0)
0