0
Hello, I have a Carraydataprovider and wanted to save your data in a table through a model, I have tried several ways and did not get result, which would be the best way to save it?
My last attempt so far:
foreach($usuarioItensAvulso as $value)
{
$model->cod_material = $value["cod_material"];
$model->des_justificativa = $value["des_justificativa"];
$model->des_quantidade = $value["des_quantidade"];
//Se as informa��es forem v�lidas, salvar e direcionar para a p�gina do Visualizar.
if ($model->validate())
{
//Faz a inclus�o do texto
$model->save();
//Exibe mensagem de salvo com sucesso
Yii::app()->user->setFlash('success', 'Salvo com sucesso.');
}
}