I’m trying to save multiple records using the active record in Yii :
In my application, the user fills out ‘n’ number of items on the frontend. Each of these items should be then stored into the item model.
foreach($items as $item)
{
$model = new Item;
$model->name = $item['name'];
$model->save();
}
Is creating a new object for the Item class required for each iteration ? AM i doing this correctly ? or is there a better way ?