mrssoft / yii2-form-widgets
Yii2 widgets for form fields
Installs: 133
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- php: >=8.0
- bower-asset/jquery.maskedinput: *
- yiisoft/yii2: *
README
Yii2 widgets for form fields
Input widgets:
- PasswordRevealWidget
- PhoneInputWidget
- MaskedPhoneInputWidget
Validators:
- PhoneValidator
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist mrssofy/yii2-form-widgets "~2.0"
or add
"mrssofy/yii2-form-widgets": "~2.0"
to the require section of your composer.json
file.
Usage
Once the extension is installed, simply use it in your code by:
$form->field($order, 'name')->widget(NameInputWidget::class); $form->field($order, 'phone')->widget(PhoneInputWidget::class); $form->field($order, 'password')->widget(PasswordRevealWidget::class);
public function rules() { return [ [['phone'], 'required'], [['phone'], PhoneValidator::class, 'returnLenght' => 10], ... ]; }