public function actionSend(){
$this->on('miao',[$this,'pao']);
$this->mao();
//这里函数调用,有啥区别,干嘛要用事件??解耦吗?
//$this->pao();
}
public function mao()
{
echo '猫再叫:miao,miao,miao....<br>';
$this->trigger('miao');
}
public function pao()
{
echo '大家快跑,快点跑跑跑...<br>';
}
添加回答
举报
0/150
提交
取消