-
Notifications
You must be signed in to change notification settings - Fork 2
Configuration
A multidimensional array of rules which will be used in the widget. These rules are not used in any form in model validation. They are used exclusively in the display of this widget.
[
[
'text' => \Yii::t('password-input', 'Must include at least one number'),
'pattern' => '/\d+/',
'showInSummary' => true, // If the value is not set at all, it will be displayed
'showAsBar' => false // If the value is not set at all, it will be displayed
]
]
Load rules based on yii\validators\RegularExpressionValidator from model rules. This only works when you use this input with the $model and $attribute value
public function rules()
{
$rules = parent::rules();
$rules[] = [
'password',
'required'
];
$rules[] = [
'password',
'match',
'pattern' => '/[0-9a-zA-Z]{8,}/',
'message' => \Yii::t('test', 'Must have at least 8 characters')
];
return $rules;
}
These values are visible as described either for the button text when showing or hiding the password. The values can also contain HTML.
Show the password fields value. This changes the initial inputs type to text instead of password.
This property controls the visibility of the button that is responsible for showing or hiding the password.
Control the widgets layout by this property
-
{input}
: The actual input group -
{bars}
: Rule bars. One per rule -
{summary}
: List of rule texts
Html attributes for toggle button
Html attributes for the input