A
A
AUN2014-11-21 20:54:48
Yii
AUN, 2014-11-21 20:54:48

url generation. How right?

Hey! Problem: wrong url generation. How to fix ?
Yes: /panel/groups/update?id=2
Needed:/panel/groups/update/2
Routing rules

'panel/groups/<factor:\w+>'=>'/admin/backend/groups',
'panel/groups/<factor:\w+>/<id:\d+>'=>'/admin/backend/groups',

Generation (piece from CGridView)
'url'=>'Yii::app()->createAbsoluteUrl(\'/admin/backend/groups\', array(\'factor\'=>\'delete\',\'id\'=>$data["id"]))',

Using matchValue ALSO fails:
array('panel/groups/<factor:\w+>'=>'/admin/backend/groups','matchValue'=>false),
'panel/groups/<factor:\w+>/<id:\d+>'=>'/admin/backend/groups',

In turn, I get the urls admin/backend/groups/factor/index (should be /panel/groups/index) and the correct one: /panel/groups/update/1

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry MiksIr, 2014-11-21
@miksir

Check other rules, most likely they overlap yours.
And the initial slash in the route is not needed - admin/backend/groups

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question