First of all I’d like to inform you that I’m a complete noob to Yii and I have this problem:
I’m trying to create a new record using $_GET to have a required model field affected. I wrote this :
$model->IdUsager = $_GET["idu"];
in the _form.php in the view.
With
echo $model->IdUsager;
I was able to confirm that the value has been set in IdUsager but since it’s a required field in the model I keep having a validation error: “Id Usager cannot be blank.”
So I tried to remove the required condition in rule() in the model but then I had an SQL exception because the field was left empty!
Can anyone help me with this?
Thanks a lot.
[color="#FF0000"][Solved][/color]
Thanks to mdomba who answered my PM with this valuable info :
Thank you for your reply, and yes I’m a complete noob on Yii and I have read most of the complete guide but I’m not able to find in it what I’m trying to do. So any other suggestions?