kakadu-dev/yii2-phone-input

Add mask to phone input

dev-master 2018-08-14 07:20 UTC

This package is auto-updated.

Last update: 2024-04-25 21:21:06 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.