我遵循网址规则:
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'rules'=>array(
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'rescues/rescueprofile/<id:\d+>'=>'rescues/rescueprofile',
// '<controller:\w+>/<breed:\w+>'=>'<controller>/view',
'/breeds/<breed:[^\/]+>' => 'breeds/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
'rescues/learn/<param1:\w+>'=>'rescues/learn',
'breeds/<breed:\w+>'=>'breeds/view',
'rescues/rescueprofile/<id:\d+>'=>'rescues/rescueprofile',
'rescues/createadoptapplication/<id:\d+>'=>'rescues/createadoptapplication',
'rescues/viewapplication/<id:\d+>'=>'rescues/viewapplication',
'rescues/editdog/<id:\d+>'=>'rescues/editdog',
'rescues/updateinfo/<name:\w+>'=>'rescues/updateinfo',
'training'=>'rescuetraining',
'<training:\w+>/<id:[a-zA-Z0-9 -]+>'=>'rescuetraining/view/<id:\w+>',
'login'=>'site/login'
),
对于救援训练控制器,我有不同的网址http://strutmymutt.com/training/life-rewards
,http://strutmymutt.com/training/sit
但最后一个“ training/sit
”不起作用。我尝试了很多不同的方法。如果我添加一些“-”来坐和一些字符,那么它就可以工作了。