Hello folks,
I’m trying to use name’s instead of ID’s on URL’s.
I’ve changed everything else and things work through an URL like:
"http://domain.com/controller/view?name=myname"
But I’m trying to make it work simply through:
http://domain.com/controller/myname
- NOTE 1. This changes the URL to a proper format, but I’m left with an error: “The system is unable to find the requested action ‘myname’”
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'rules'=>array(
'<controller:\w+>/<name:\d+>'=>'<controller>/view', // *NOTE 1.
'<controller:\w+>/<action:\w+>/<name:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
/* Working version with the ID
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
*/
),
),
Can’t really figure out what I’m doing wrong here.