corvus
(Yiiframework)
January 12, 2011, 5:42pm
1
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
corvus
(Yiiframework)
January 12, 2011, 6:20pm
2
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?
tri
(tri - Tommy Riboe)
January 12, 2011, 7:32pm
3
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
gusnips
(Gustavo)
January 20, 2011, 2:22pm
4
also a rule like
'rules'=>array("."=>'site/maintenance');
would work