diff --git a/apps/advanced/backend/web/css/site.css b/apps/advanced/backend/web/css/site.css index 068d5fd..c9bc751 100644 --- a/apps/advanced/backend/web/css/site.css +++ b/apps/advanced/backend/web/css/site.css @@ -76,12 +76,6 @@ a.desc:after { white-space: nowrap; } -.hint-block { - display: block; - margin-top: 5px; - color: #999; -} - .error-summary { color: #a94442; background: #fdf7f7; diff --git a/apps/advanced/frontend/web/css/site.css b/apps/advanced/frontend/web/css/site.css index 068d5fd..c9bc751 100644 --- a/apps/advanced/frontend/web/css/site.css +++ b/apps/advanced/frontend/web/css/site.css @@ -76,12 +76,6 @@ a.desc:after { white-space: nowrap; } -.hint-block { - display: block; - margin-top: 5px; - color: #999; -} - .error-summary { color: #a94442; background: #fdf7f7; diff --git a/apps/basic/web/css/site.css b/apps/basic/web/css/site.css index 068d5fd..c9bc751 100644 --- a/apps/basic/web/css/site.css +++ b/apps/basic/web/css/site.css @@ -76,12 +76,6 @@ a.desc:after { white-space: nowrap; } -.hint-block { - display: block; - margin-top: 5px; - color: #999; -} - .error-summary { color: #a94442; background: #fdf7f7; diff --git a/docs/guide/form.md b/docs/guide/form.md index 2146f1d..34a6c67 100644 --- a/docs/guide/form.md +++ b/docs/guide/form.md @@ -107,8 +107,8 @@ or <?= Html::activeLabel($model, 'username', ['label' => 'name']) ?> <?= Html::activeTextInput($model, 'username') ?> -<?= Html::error($model, 'username') ?> <div class="hint-block">Please enter your name</div> +<?= Html::error($model, 'username') ?> ``` If you want to use one of HTML5 fields you may specify input type directly like the following: diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index c428dc3..0f0ce84 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -121,6 +121,7 @@ Yii Framework 2 Change Log - Chg #1821: Changed default values for yii\db\Connection username and password to null (cebe) - Chg #1844: `Response::sendFile()` and other file sending methods will not send the response (qiangxue) - Chg #1852: DbConnection::tablePrefix default value now 'tbl_' (creocoder) +- Chg #1856: The default CSS class for hint generated by `ActiveField` is changed to `help-block` (qiangxue, crocoder) - Chg #1958: `beforeSubmit` in `yii.activeform` is now executed after validation and before form submission (6pblcb) - Chg #2025: Removed ability to declare scopes in ActiveRecord (samdark) - Chg #2043: diff --git a/framework/widgets/ActiveField.php b/framework/widgets/ActiveField.php index 13e510e..bb9b0ff 100644 --- a/framework/widgets/ActiveField.php +++ b/framework/widgets/ActiveField.php @@ -70,7 +70,7 @@ class ActiveField extends Component * * - tag: the tag name of the container element. Defaults to "div". */ - public $hintOptions = ['class' => 'hint-block']; + public $hintOptions = ['class' => 'help-block']; /** * @var boolean whether to enable client-side data validation. * If not set, it will take the value of [[ActiveForm::enableClientValidation]].