大话西游666
首先写一个例子,在siteController中覆盖behaviors函数public function behaviors(){return ['access' => ['class'=>AuthFilter::className(),'only'=>['index'],],'access11' => ['class'=>AuthFilter::className(),'only'=>['index'],],];}AuthFilter的定义class AuthFilter extends ActionFilter{