Hi,
I like your book, but I have a question about returning error messages from an model[]
On site 96 you show following example
public function actionIndex()
{
$models = array();
if(!empty($_POST['Task']))
{
foreach($_POST['Task'] as $taskData)
{
$model = new Task();
$model->setAttributes($taskData);
if($model->validate())
$models[] = $model;
}
}
}
What is happening here?
if($model->validate())
$models[] = $model;
Example:
I’ve added 4 Tasks on my view file and the third input field fails, because the user don’t input a title.
How can I show the error-Message for field 3?
How does I now that field 3 returns an error?
thx