action parameter binding

Hi all…

I am trying to pass a string to ma action instead of an ID. but when i do that i get 400 ERROR.

here is my sample code…

public function actionAll($category)


	echo $category;



which is in members controller…

so my url is

as i said i get "Error 400 Your request is invalid." error.

I have referred to

but dint achieve it… only $id works… Please help…


can you submit view file code ?


This is not an view issue.

You are trying to pass text GET parameter in path style. This is possible, however default routing rules are matching only numeric "id" parameter.

In order to make your example working you have to add routing in your main.php config like this:


You should also always use createUrl method - it will generate proper url no matter if you have routing rules defined or not (if not - the url will have form like this:

After few minutes one more think comes to my mind - your parameter name “action” can be in conflict with default routing rule where ‘action’ actually points to controllers action. If above solution won’t work, try to change your param name.

@redguy… Well that worked for me… Thanks:) i should have checked it first only:)