Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

yiisoft/yii-masked-input

Folders and files

NameName
Last commit message
Last commit date

Latest commit

41da374 · Oct 12, 2022

History

76 Commits
May 12, 2021
Apr 13, 2021
Jun 2, 2022
Jun 2, 2022
Apr 13, 2021
Jan 12, 2022
Jan 28, 2022
Feb 6, 2018
Nov 29, 2020
Jan 12, 2022
Sep 7, 2021
Dec 6, 2019
Nov 15, 2020
Oct 12, 2022
Feb 10, 2022
Apr 30, 2019

This package is deprecated.


Yii Framework Masked input widget Extension


This is the Masked Input extension for Yii framework. It provides a masked input widget based on jQuery Input Mask plugin.

For license information check the LICENSE-file.

Latest Stable Version Total Downloads Build Status

Installation

The preferred way to install this extension is through composer.

composer require --prefer-dist yiisoft/yii-masked-input

Usage

To use MaskedInput, you must set the [[mask]] property. The following example shows how to use MaskedInput to collect phone numbers:

echo MaskedInput::widget([
    'name' => 'phone',
    'mask' => '999-999-9999',
]);

You can also use this widget in an [[ActiveForm]] using the [[ActiveField::widget()|widget()]] method, for example like this:

<?= $form
    ->field($model, 'from_date')
    ->widget(Yiisoft\Yii\MaskedInput\MaskedInput::class, [
        'mask' => '999-999-9999',
    ]) ?>