eluhr / yii2-password-input
Password Input for Yii2
Installs: 2 963
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 1
Forks: 2
Open Issues: 0
Requires
- yiisoft/yii2: ^2.0
README
Installation
composer require eluhr/yii2-password-input
Example usage
<?php use eluhr\passwordInput\widgets\PasswordInput; use yii\helpers\Html; use yii\widgets\ActiveForm; $form = ActiveForm::begin(); echo $form->field($model, 'password')->widget(PasswordInput::class, [ 'buttonLabelShow' => \Yii::t('password-input', 'Show'), 'buttonLabelHide' => \Yii::t('password-input', 'Hide'), 'layout' => "{input}\n{bars}\n{summary}", 'loadRulesFromModel' => false, 'rules' => [ [ 'text' => 'Must be at least 8 characters long', 'pattern' => '/[0-9a-zA-Z]{8,}/' ], [ 'text' => 'Must include at least one number', 'pattern' => '/\d+/' ], [ 'text' => 'Must contain the letter "a"', 'pattern' => '/a/', 'showAsBar' => false ], [ 'text' => 'Must not be empty', 'pattern' => '/.+/', 'showInSummary' => false ] ], 'showPasswordByDefault' => false, 'showShowPasswordButton' => true ]); echo Html::submitButton(); ActiveForm::end(); ?>
Configuration
For configuration options please refer to the Wiki