xiumei
在controller的Action中写的绑定事件,之后事件不会执行,
请问题主的controller继承的是哪个呢?我继承的是yii\web\Controller。
/*** @param string $id the ID of this controller. * @param Module $module the module that this controller belongs to. * @param array $config name-value pairs that will be used to initialize the object properties. */ public function __construct($id, $module, $config = []) { $this->id = $id; $this->module = $module; parent::__construct($config); }
难道必须要把on写到构造函数里?没道理啊
在controller的Action中写的绑定事件,之后事件不会执行,
请问题主的controller继承的是哪个呢?我继承的是yii\web\Controller。
/*** @param string $id the ID of this controller. * @param Module $module the module that this controller belongs to. * @param array $config name-value pairs that will be used to initialize the object properties. */ public function __construct($id, $module, $config = []) { $this->id = $id; $this->module = $module; parent::__construct($config); }