2020
10-18
10-18
Yii中特殊行为ActionFilter的使用方法示例
新建app\filters\LoggingFilter继承yii\base\ActionFilterLoggingFilter的功能:在指定请求的action前后各记录一条日志<?phpnamespaceapp\filters;useyii\base\ActionFilter;classLoggingFilterextendsActionFilter{publicfunctionbeforeAction($action){parent::beforeAction($action);//Todosomethingprintf('Thisisaloggingfor%s\beforeAction.%s',$this->getActionId($action),PHP_EOL);...
继续阅读 >