I’m curious, why is it so, that in a controller’s function (for example in actionAdmin()), a parameter is only allowed to be $id. I’ve tried to use $whatever, but I get Error 400 Your request is invalid. If I change it back to $id, everything is fine. Can somebody explain me why is that?
So you’re specifically specifying one argument that can be passed on to your action, and that argument is named [font=“Courier New”]$id[/font]. If you wanted to change the argument name in your urls, you have to change it as well in the action function declaration:
public function actionAdminTree($whatever) { // Here
$model = new Gyartmany('searchTree');
$model->unsetAttributes();
if (isset($_GET['Gyartmany']))
$model->setAttributes($_GET['Gyartmany']);
$this->render('adminTree', array(
'model' => $model,
'id' => $whatever, // Here as well, of course
));
}
that’s where the problem is. What canI do with it? I mean I know I can replace the specific line, or add a new line, but I don’t want to mess up everything. what is the good solution for this? at first I read through the guide.