0
我下面的URL規則:地址管理問題的Yii
'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'
),
對於rescuetraining控制器,我有不同的URL http://strutmymutt.com/training/life-rewards
和http://strutmymutt.com/training/sit
,但最後一個「training/sit
」是行不通的。我嘗試了很多不同的方式。如果我添加一些「 - 」坐下來,然後一些字符正在工作。