I have a view:
<?= $form->field($registration, 'username',
['template' => '<div class="uk-form-row">
<label for="register_username">{label}</label>
{input}{error}
</div>'])
->textInput(['class' => 'md-input']) ?>
And I want it to add new class to textInput after the error was triggered.
In the model there's some rules for this input:
['username', 'string', 'min' => 2, 'max' => 255, 'message' => 'Can not be blank'],
['username','required']
And for example if I type 1 symbols that will trigger an error that will say Can not be blank. But also I want to add md-input-danger class on this input. Is there's a proper way to do that?