I do understand the concept of the Observer Pubsub and MVC pattern. I use it in jQuery for instance. Symfony documentation also seems decent, so the usage of the component isn't really an issue but the concept is kinda confusing for me. Could you point some real-life examples (dummy code would be awesome) of using this pattern in Symfony? Can I use it in several different controllers or controller's methods only?
Asked
Active
Viewed 733 times
2 Answers
1
I think Form.php is a good example. If you look at bind method (which is called during bindRequest
method call) it dispatches various events. For info about those events take a look at this answer. Also check this cookbook entry for adding event listener.
Edit: It seems there is a cookbook section on event dispatcher. Check here.

Community
- 1
- 1

Mun Mun Das
- 14,992
- 2
- 44
- 43
0
I think you should go through
https://github.com/beberlei/AcmePizzaBundle
it shows you how to build forms using form builder and interact with the database.

Shrujan Shetty
- 2,298
- 3
- 27
- 44
-
I didn't find **any** instance of EventDispatcher in the bundle. – acid Apr 24 '12 at 11:23