Merge pull request #10 from dicrtarasov/dicr-fix-hint-options

fixed #9 default ActiveField::hintOptions
This commit is contained in:
simialbi 2021-08-16 09:14:04 +02:00 committed by GitHub
commit bba225c157
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -4,7 +4,7 @@ Yii Framework 2 bootstrap5 extension Change Log
2.0.2 under development 2.0.2 under development
----------------------- -----------------------
- no changes in this release. - Bug #9: fixed default ActiveField::hintOptions (dicrtarasov)
2.0.1 August 11, 2021 2.0.1 August 11, 2021

View File

@ -156,7 +156,7 @@ class ActiveField extends \yii\widgets\ActiveField
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public $hintOptions = ['class' => ['widget' => 'form-text', 'text-muted'], 'tag' => 'small']; public $hintOptions = ['class' => ['widget' => 'form-text', 'text-muted'], 'tag' => 'div'];
/** /**
* @var null|array CSS grid classes for horizontal layout. This must be an array with these keys: * @var null|array CSS grid classes for horizontal layout. This must be an array with these keys:
* - 'offset' the offset grid class to append to the wrapper if no label is rendered * - 'offset' the offset grid class to append to the wrapper if no label is rendered
@ -494,7 +494,7 @@ class ActiveField extends \yii\widgets\ActiveField
{ {
$config = [ $config = [
'hintOptions' => [ 'hintOptions' => [
'tag' => 'small', 'tag' => 'div',
'class' => ['form-text', 'text-muted'], 'class' => ['form-text', 'text-muted'],
], ],
'errorOptions' => [ 'errorOptions' => [

View File

@ -291,7 +291,7 @@ HTML;
<div class="mb-3 field-user-username required"> <div class="mb-3 field-user-username required">
<label class="form-label" for="user-username">Username</label> <label class="form-label" for="user-username">Username</label>
<input type="text" id="user-username" class="form-control" name="User[username]" aria-required="true"> <input type="text" id="user-username" class="form-control" name="User[username]" aria-required="true">
<small class="form-text text-muted">Your username must be at least 4 characters long</small> <div class="form-text text-muted">Your username must be at least 4 characters long</div>
<div class="invalid-feedback"></div> <div class="invalid-feedback"></div>
</div> </div>
HTML; HTML;
@ -299,7 +299,7 @@ HTML;
<div class="mb-3 field-user-password required"> <div class="mb-3 field-user-password required">
<label class="form-label" for="user-password">Password</label> <label class="form-label" for="user-password">Password</label>
<input type="password" id="user-password" class="form-control" name="User[password]" aria-required="true"> <input type="password" id="user-password" class="form-control" name="User[password]" aria-required="true">
<small class="form-text text-muted">Your password must be 8-20 characters long, contain letters and numbers, and must not contain spaces, special characters, or emoji.</small> <div class="form-text text-muted">Your password must be 8-20 characters long, contain letters and numbers, and must not contain spaces, special characters, or emoji.</div>
<div class="invalid-feedback"></div> <div class="invalid-feedback"></div>
</div> </div>
HTML; HTML;
@ -330,7 +330,7 @@ HTML;
<div class="mb-3 field-user-username required"> <div class="mb-3 field-user-username required">
<label class="form-label" for="user-username">Username</label> <label class="form-label" for="user-username">Username</label>
<input type="text" id="user-username" class="form-control is-invalid" name="User[username]" aria-required="true" aria-invalid="true"> <input type="text" id="user-username" class="form-control is-invalid" name="User[username]" aria-required="true" aria-invalid="true">
<small class="form-text text-muted">Your username must be at least 4 characters long</small> <div class="form-text text-muted">Your username must be at least 4 characters long</div>
<div class="invalid-feedback">Username cannot be blank.</div> <div class="invalid-feedback">Username cannot be blank.</div>
</div> </div>
HTML; HTML;