kakadu-dev / yii2-phone-input
Add mask to phone input
Installs: 9
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2025-02-25 23:00:00 UTC
README
Add phone mask to input.
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist matthew-p/yii2-phone-input "@dev"
or add
"kakadu-dev/yii2-phone-input": "@dev"
to the require section of your composer.json
file.
Usage
Once the extension is installed, simply use it in your code by:
Add action in controller (only for gridview sorting):
<?php use Kakadu\Yii2PhoneInput\MPInputPhoneMask; echo $form->field($model, 'phone')->widget(MPInputPhoneMask::class, ['options' => ['type' => 'tel', 'autocomplete' => 'off']]) ?>
That's all. Check it.