Commit 855b913d by Alexander Makarov

Documented "Catching all incoming requests"

parent 6b603c06
...@@ -244,7 +244,24 @@ Two other filters, [[yii\web\PageCache]] and [[yii\web\HttpCache]] are described ...@@ -244,7 +244,24 @@ Two other filters, [[yii\web\PageCache]] and [[yii\web\HttpCache]] are described
Catching all incoming requests Catching all incoming requests
------------------------------ ------------------------------
TBD Sometimes it is useful to handle all incoming requests with a single controller action. For example, displaying a notice
when website is in maintenance mode. In order to do it you should configure web application `catchAll` property either
dynamically or via application config:
```php
$config = [
'id' => 'basic',
'basePath' => dirname(__DIR__),
// ...
'catchAll' => [ // <-- here
'offline/notice',
'param1' => 'value1',
'param2' => 'value2',
],
```
In the above `offline/notice` refer to `OfflineController::actionNotice()`. `param1` and `param2` are parameters passed
to action method.
Custom response class Custom response class
--------------------- ---------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment