I
I
ImPuuLsE2016-02-22 14:50:01
Yii
ImPuuLsE, 2016-02-22 14:50:01

How to add on beforeRequest to Yii2 config?

Hello! available:

Class CmsApplication extends Application
{
    public function __construct($config=null){
        parent::__construct($config);
    }

how to add this to config:
'on beforeRequest' => function () {
                    Yii::$app->catchAll = [
                        'site/default/index',
                        'message' => 'сайт не доступен'
                    ];
                }

Thanks in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2017-05-25
@webinar

[
'modules'=>[],
'components'=>[],
'on beforeRequest' => function () {
                    Yii::$app->catchAll = [
                        'site/default/index',
                        'message' => 'сайт не доступен'
                    ];
                },
'params'=>[]
]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question