hi all i am getting result in array format http://pastebin.com/NQDKmQ7k if i add echo model->enum_name; i am getting "array" as the value and not the value … Please let me know how do i get the actual value enum_name[0] displayed in the form
I had to troubleshoot this problem by explicitly assigning each of the array values to my model instances (remember, each array index will require its own model object to assign to)
$mymodels=array();
//Get the number of models you will be working with
$maxRows = count($_POST['enum_name']);
//for each form table row, iterate through and store valid model rows in $mymodels
for ($i = 0; $i <= $maxRows; $i++)
{
//rudimentary validation - just check if there's something there, then create a model with new values
if(isset($_POST['enum_name'][$i]))
{
$tmpMyModel = new MyModelClass();
//Set variables based on form input - make sure all necessary fields are present before saving
$tmpMyModel->enum_name = $_POST['enum_name'][$i];
if($tmpMyModel->validate()){
//What do you want to do with the model? How about just save it?
$tmpMyModel->save();
}
else {
print_r("DOES NOT VALIDATE");
}
}
}