The catchAll route
Sometimes you need to temporarily put the app in maintenance mode and one to display an informational message for all queries. There are many options to implement this task. But one of the easiest is to use the properties of yii\web\Application::catchAll
, such as:
'catchAll' => ['site/offline'],
In this case, the action site/offline will handle all incoming requests.
The catchAll property should take an array whose first element determines the route, and the other elements (key and value) define the parameters passed to the action.