Yii指定控制器处理全部请求

279 阅读1分钟
有时候网站升级的时候,需要指定控制器处理全部请求,Yii中设置如下:
打开配置文件main.php,在数组中加上:

1'catchAllRequest'=>array('update/index'),


创建UpdateController:

1
2
3
4
5
6
7
classUpdateControllerextendsController
{
functionactionIndex(){
// $this->render('index');
$this->renderPartial('index');
}
}


创建views,update/index.php:

1网站升级中。。。