bettor
(Live Webscore)
March 6, 2012, 2:31pm
1
I am trying to setup url rule for my categories. I have
http://url.com/index.php/category/index&catid=Catname
I want to transform this to
http://url.com/index.php/Catname
I can easily achieve it with the following rule:
'<catid:\w+>'=>'category/index',
but when clicked on a category it does not work. It says Error 404
Unable to resolve the request "Catname".
So looks like the framework does not understand that this parameter belongs to category/index route even though I’ve defined it in the config and it is rendering it as per the config.
Am I missing anything?
Thanks,
bettor
mbi
(mbi)
March 6, 2012, 4:35pm
2
please post all your rules of urlmanager
bettor
(Live Webscore)
March 6, 2012, 4:40pm
3
'urlManager'=>array(
'urlFormat'=>'path',
'rules'=>array(
'<catid:\w+>'=>'category/index',
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
),
bettor
(Live Webscore)
March 7, 2012, 11:00am
4
so is this a bug or design limitation that we are not suppose to use it that way? I should be able to render http://url/parameter instead of http://url/controller/action/parameter
anyone?