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>'; }
qq_天涯问路_0