Question About Urlmanager Rules Regarding Id

Hello everyone,

First of all, I want to thank the creators of Yii for making such a great framework.

I have a (maybe silly) question about the URL rules.
















A rule like “‘login/’=>‘site/login’,” works perfectly, but if I want to map e.g. ‘page/view/1’ to ‘over-budgetkar’, it isn’t working. I get a 400 http error. Do you see what I’m doing wrong and do you known an answer?

Many thanks in advance.

Assuming that your action signature is something like

public function actionView($id)

the rule may look like this:

'over-budgetkar' => array('page/view', 'defaultParams' => array('id' => 1)),

You can read more on that right here.

Thank you very much, this is indeed the right solution.