在配置文件main.php中:
'urlManager'=>array(
'urlSuffix' => '.html', //action加上.html后缀,全局后缀为.html
'showScriptName'=>false,
'urlFormat'=>'path',
'rules'=>array(
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>/<pid:\d>'=>'<controller>/<action>/<pid>',
'versionReq'=>array('/versionReq', 'urlSuffix'=>'.jsp', 'caseSensitive'=>false),//单一接口的后缀名
),
),
重命名某个请求url,将'profile/profileBase/index'
重命名为 'profile/read/index'
'urlManager' => array(
'urlFormat' => 'path',
'showScriptName' => false,
'rules' => array(
'profile/read/index '=>'profile/profileBase/index'
),
),
网友评论