Hi folks,
I’m having some problems to pass more than one parameter on url.
I’m using tha url path and hen I pass only one parameter, everything works great like it:
$options = array('id' => 5);
CHtml::link($model->$field, Yii::app()->getController()->createUrl('update', $options);
#output http://amma.dev/admin/taxonomies/update/5
# print_r($_GET) prints Array('id' => 5)
But, when I passed 2 (or more) parameters, this happend:
$options = array('type' => 'Product', id' => 5);
CHtml::link($model->$field, Yii::app()->getController()->createUrl('update', $options);
#output http://amma.dev/admin/taxonomies/update/Product/5 - the expected result
# print_r($_GET) prints Array('Product' => 5)
ie I can’t get the id or Product params becouse the key of id change to value of type.
My urlManager configuration is:
'admin/<controller:\w+>/<action:\w+>/<type:\w>/<id:\d+>' =>'admin/<controller>/<action>',
'admin/<controller:\w+>/<action:\w+>/<type:\w+>' =>'admin/<controller>/<action>',
'admin/<controller:\w+>/<action:\w+>/<id:\d+>' =>'admin/<controller>/<action>',
'admin/<controller:\w+>/<action:\w+>/' =>'admin/<controller>/<action>',
'<controller:\w+>/<id:\d+>' =>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>' =>'<controller>/<action>',
'<controller:\w+>/<action:\w+>' =>'<controller>/<action>',
Anyone have an Idea of why this are happening?
Thanks.