O'Reilly logo

Extending Symfony2 Web Application Framework by Sébastien Armand

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Listeners

Listeners are a way of implementing the observer's design pattern. In this pattern, a particular piece of code does not try to start the execution of all the code that should happen at a given time. Instead, it notifies all of its observers that it has reached a given point in execution and lets these observers to take over the control flow if they have to.

In Symfony, we use the observer's pattern through events. Any class or function can trigger an event whenever it sees the event fit. The event itself can be defined in a class. This allows the passing of more information to the code observing this event. The framework itself will trigger events at different points in the process of handling the requests. These events are as follows: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required