In the controller, I'm using loadMultiple and validateMultiple to validate several models of the same class.
In the view where I render the form, I have this (as explained in the doc):
<?php foreach ($addresses as $index => $address) { ?>
<?=
$form->field($address, "[$index]emailAddress")
->textInput(['placeholder' => Yii::t('label', "Enter email address")])
->label(false);
?>
<?php } ?>
If one of the models doesn't validate (server-side), an error message should be displayed.
The error message is not showing, because the class "has-error" is missing.
If I name the attribute "emailAddress"
instead of "[$index]emailAddress"
, it works as expected.
| Yii version | 2.0.14.1
| PHP version | 5.6.19
| Operating system | Windows 10
Duplicated #15801 and solved with 2.0.14.2 hotfix release
Most helpful comment
Duplicated #15801 and solved with 2.0.14.2 hotfix release