Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
033d5e73
Commit
033d5e73
authored
Nov 02, 2014
by
花生
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update concept-events.md
修正小错误
parent
af36c9d6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
concept-events.md
docs/guide-zh-CN/concept-events.md
+2
-2
No files found.
docs/guide-zh-CN/concept-events.md
View file @
033d5e73
...
...
@@ -65,7 +65,7 @@ $foo->on(Foo::EVENT_HELLO, function ($event) {
```
时间
处理器顺序
事件
处理器顺序
-----------------
可以附加一个或多个处理器到一个事件。当事件被触发,已附加的处理器将按附加次序依次调用。如果某个处理器需要停止其后的处理器调用,可以设置
`$event`
参数的
[
yii\base\Event::handled
]
] 属性为真,如下:
...
...
@@ -78,7 +78,7 @@ $foo->on(Foo::EVENT_HELLO, function ($event) {
默认新附加的事件处理器排在已存在处理器队列的最后。因此,这个处理器将在事件被触发时最后一个调用。在处理器队列最前面插入新处理器将使该处理器最先调用,可以传递第四个参数
`$append`
为假并调用
[
[yii\base\Component::on()
]
] 方法实现:
``php
``
`
php
$foo
->
on
(
Foo
::
EVENT_HELLO
,
function
(
$event
)
{
// 这个处理器将被插入到处理器队列的第一位...
},
$data
,
false
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment