Yii doesn't add "has-error" class when template option is used in ActiveForm

I need to display my form fields in a table, so I use ActiveField’s template option like this:

echo $form->field($user, 'user_email_mess', [
	'template' => '<tr><td>{label}</td><td><div class="group-form">{input}{hint}{error}</div></td></tr>',
	'inputOptions' => []
])->label(Yii::t('app', 'Email') . ': *');

But then if there is an error, the class “has-error” is not set on <div class="group-form">. How can I use a custom template, without losing optional classes that yii adds dynamically to the markup?

No response? :thinking:

@smohadjer nope, not yet.