K
K
kotepdag2019-12-19 10:59:16
Yii
kotepdag, 2019-12-19 10:59:16

Bootstrap for entire application in Yii2?

I installed the "site settings" module, there is a component there, added it to the bootstrap components in config
For example, I have the item "is the site enabled?"
I need to check setting value and if site is down -> catchAll add to urlManager.
The question is, where and how to make Bootstrap for the whole application in yii ?
So that all components are available in it, and I can do something before transferring control to the controller?
For example check the setting value and "disable" the site.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vlad Osadchyi, 2019-12-19
@kotepdag

Config web.php:
MaintenanceMode:
In filtering check for desired conditions and

Yii::$app->catchAll = [self::MAINTENANCE_MODE_ROUTE];
, if needed

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question