create maintenance page

hi!

how can i create a maintenance page?

i want to global check a application-level parameter (e.g. Yii::app()->params[‘maintenance’] == true) and if this is true it should always display the maintenance page whatever page is requested.

where to put the code for the check? sitecontroller?

thanks,

corvus

tested this (http://www.yiiframework.com/forum/index.php?/topic/3975-maintenance-mode/page__p__21329__hl__maintenance#entry21329)

created the view and put this into my config/main.php


'catchAllRequest' => Yii::app()->params['maintenance'] ? array('site/maintenance') : null,



but dont work for me. any ideas?

This use to be a problem when people want to use basePath from within the config array (before it’s defined, that is).

I posted a possible solution here.

In your case




'catchAllRequest' => $preConfig['params']['maintenance'] ? array('site/maintenance') : null,



/Tommy

also a rule like


'rules'=>array("."=>'site/maintenance');

would work