Update BaseHtml.php

This commit is contained in:
Anton 2022-05-03 20:26:05 +03:00 committed by GitHub
parent a32e10561b
commit 2e42954f28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -145,7 +145,9 @@ abstract class BaseHtml extends \yii\helpers\Html
*/ */
public static function error($model, $attribute, $options = []): string public static function error($model, $attribute, $options = []): string
{ {
static::addCssClass($options, 'invalid-feedback'); if (!array_key_exists('class', $options)) {
$options['class'] = ['invalid-feedback'];
}
return parent::error($model, $attribute, $options); return parent::error($model, $attribute, $options);
} }