Hi,
my question is about how can I handle array as parameter (generatated by a form) in controller.
I have a form:
...
<input name="id" type="hidden" value="345"/><br/>
<lable>Val 1</label><input name="arr[]" type="checkbox" value="700"/><br/>
<lable>Val 2</label><input name="arr[]" type="checkbox" value="800"/><br/>
<lable>Val 3</label><input name="arr[]" type="checkbox" value="900"/><br/>
...
The form’s ‘action’ parameter is a conrollers function:
public function actionSaveMyForm($id, $arr) {
print_r($arr); // it doesn't work: CHttpException: You are not authorized to perform this action
}
My opinion: this error is because of $arr parameter: yii waits for ‘arr’ in URL (form method is GET), but the URL is: …index.php?r=MyController/SaveMyForm&id=7&arr[]=700&arr[]=800
How can I get the whole $arr array in the controllers function?
Thanks for any help