Hello, I have a CArrayDataProvider and I wanted to save your data to a table via a model, I already tried it in several ways and did not get results, what 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.');
}
}