In yii2, what should I do if I want to execute some logic before the specific operation method? The current practice is to extract a basic controller and write it in the beforeAction. I would like to ask if I can configure it through the configuration file. Thanks to yii2, what should I do if I want to execute some logic before the specific operation method?
The current practice is to extract a basic controller and write it in the beforeAction.
I would like to ask if I can configure it through the configuration file.
Thanks
Reply content:
In yii2, what should I do if I want to execute some logic before the specific operation method?
The current practice is to extract a basic controller and write it in the beforeAction.
I would like to ask if I can configure it through the configuration file.
Thanks
Resolved
$ Params = array_merge (require (_ DIR __. '/.. /.. /common/config/params. php '), require (_ DIR __. '/.. /.. /common/config/params-local.php '), require (_ DIR __. '/params. php '), require (_ DIR __. '/params-local.php'); return ['id' => 'back-frontend ',... 'components' => [...], 'On beforeaction' => [\ frontend \ behaviors \ CheckPermission: className (), 'kunxtest',],...];
Content from: link description