I was reading the documentation about Events and Behaviors. Very Interesting reading about Behaviors BTW. Still have to digest that. The comments have a "Real World Example" of an event. Basically an event is conditionally registered in the after save event, then a method is attached to the event, then the event is enabled in the controller. But why all the extra event handling? Couldn't I just call my method in the afterSave method? What is the advantage to all the extra event handling code?
I wanted to ask this question in context, but I am too new to post comments there.
Here is the page I am referring to: http://www.yiiframew...ehaviors-events
Page 1 of 1
Event Example from Documentation
#3
Posted 02 August 2012 - 07:27 AM
JMarkMurphy, on 21 March 2012 - 11:00 PM, said:
I was reading the documentation about Events and Behaviors. Very Interesting reading about Behaviors BTW. Still have to digest that. The comments have a "Real World Example" of an event. Basically an event is conditionally registered in the after save event, then a method is attached to the event, then the event is enabled in the controller. But why all the extra event handling? Couldn't I just call my method in the afterSave method? What is the advantage to all the extra event handling code?
I wanted to ask this question in context, but I am too new to post comments there.
Here is the page I am referring to: http://www.yiiframew...ehaviors-events
I wanted to ask this question in context, but I am too new to post comments there.
Here is the page I am referring to: http://www.yiiframew...ehaviors-events
After hours of reading I also don't get it (yet)... why use events when in the end you still have to invoke them manually
I think I just don't get it.. What did make YOU (reader) understand Events in Yii? All help is welcome.
Share this topic:
Page 1 of 1

Help












