Edited Introduction

Cut a sentence that seemed both redundant and vague. Could just be me.
This commit is contained in:
Larry Ullman
2014-04-25 20:16:47 -04:00
parent 7b374c4126
commit bbefc33c9c

View File

@@ -1,11 +1,10 @@
Events Events
====== ======
Event is a way to "inject" custom code into existing code at certain places. For example, a comment object can trigger Yii uses events to "inject" custom code into existing code at certain execution points. For example, a comment object can trigger
an "add" event when the user adds a comment. We can write custom code and attach it to this event so that when the event an "add" event when the user adds a comment to a post.
is triggered (i.e. comment will be added), our custom code will be executed.
Events are very useful both to make your components flexible and to hook into framework and extensions workflow. Events are very useful for two reasons. First, they can make your components more flexible. Second, you can hook your own code into the regular workflow of both the framework and the extensions in use.
Triggering events Triggering events
----------------- -----------------