Execute my code before any action of any controller

后端 未结 5 1610
我寻月下人不归
我寻月下人不归 2020-12-05 00:21

I would like to check if my user have filled certain fields in his profile before he can access any action of any controller. For example

if(empty(field1) &         


        
5条回答
  •  佛祖请我去吃肉
    2020-12-05 00:57

    Just i think this code on config file can help you:

    'on beforeAction' => function ($event) {
          // To log all request information
    },
    'components' => [
        'response' => [
            'on beforeSend' => function($event) {
                // To log all response information
            },
        ],
    ];
    

提交回复
热议问题