'urlManager'=>array(
'class'=>'application.components.UrlManager',
'urlSuffix'=>'/',
'baseUrl'=>'',
'showScriptName'=>false,
'urlFormat'=>'path',
'rules'=>array(
'<language:\w{2}>' => 'page/index',
'' => 'page/index',
'<language:\w{2}>/page/<alias:.*>' => 'pages/read',
)
链接“/en/page/index”工作正常
链接“/”和“/en”返回错误“无法解析请求”页面/索引“。
规则有什么问题
'<language:\w{2}>' => 'page/index'
'' => 'page/index',
?
升级版:
pagesController 有一个动作:
public function actionRead($alias){
//some php code...
if($model==null)
{
throw new CHttpException(404,'page not found...');
}else
{
$this->render('read',array('model'=>(object)$model));
}
}