Hello, i’m reading to the _form.php file of a view created with gii related to a model and therefore a table in my DB.
lets say that "MOD" is some model created with gii.
The model MOD gives me some rules for the fields in the table MOD.
The MODcontroller file manage the logic of the _form.php
I read that if I do:
Name: <input type="text" name="fname" />
Then to get the data from the post method it should be:
<?php echo $_POST["fname"]; ?>
But in the MOD/_form.php file all fields have diferent names, and MODController receive the POST message using:
<?php $model->attributes=$_POST["MOD"]; ?>
Why the controller doesnt call $_post["x"] for each of the values from the model and can use a general name to
get the values???
I’m trying to replicate this in my own controller and view, but I can only receive the post data using exactly the names of each fields …
Please help me understand this =)