Multiple Parameters Not Working With Controller Actions

Hi,

I get an exception when I try to pass multiple parameters to an action, even though the action is correctly defined.

exception ‘CHttpException’ with message ‘Your request is invalid.’

Doesn’t work


localhost/test/trip/purchase/1/1

Works


localhost/test/trip/purchase/1

The action:


public function actionPurchase($id, $partnerId = null) {

Can I configure this in the URL manager? I wasn’t able to get it to work.

Thanks

When you do not give the parameter name and you pass only 1 parameter the parameter name "id" is assumed, but when you pass more parameters you need to tell their names:


localhost/test/trip/purchase/id/1/partnerId/1

First of all check your URL manager settings in main.php file (just to make sure that there is no any special condition)

Then pass the parameters in your request url as Ronald_ said. So, your link is something like this.




echo chtml:link('link1',array('test/trip','id'=>1,'parentid'=>1));