Multiple Parameters Not Working With Controller Actions


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




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.


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:


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));