mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-13 12:49:04 +08:00
Edited Introduction
Cut a sentence that seemed both redundant and vague. Could just be me.
This commit is contained in:
@@ -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
|
||||||
-----------------
|
-----------------
|
||||||
|
|||||||
Reference in New Issue
Block a user