How do event priorities work in Symfony?
29 July 2024 (Updated 29 July 2024)
The Symfony event system uses integers to indicate the priority of an event listener where the higher the number, the earlier the event listener is executed.
The priorities of the internal Symfony event listeners usually range from -256
to 256
. When adding your custom event listeners, you can define an integer to control when your event listener should run in relation to either Symfony’s internal event listeners or your other custom event listeners.
Sources & further readings
Tagged:
Symfony
Thanks for your comment 🙏. Once it's approved, it will appear here.
Leave a comment