Execute my code before any action of any controller

后端 未结 5 1611
我寻月下人不归
我寻月下人不归 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:52

    Just add in config file into $config array:

        'on beforeAction' => function ($event) {
               echo "Hello";
        },
    

提交回复
热议问题