yii2-extension inputmask-multi
Yii2 wrapper for Inputmask Multi
nezhura/inputmask-multi
Yii2 wrapper for Inputmask Multi
- Sunday, December 3, 2017
- by ivan-nezhura
- Repository
- 1 Watchers
- 1 Stars
- 10 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 2 Versions
- 11 % Grown
For JS plugin details refer to official page, (*1)
Usage
use inputmaskMulti\MaskedPhoneInput;
use yii\web\JsExpression;
$inputmaskOptions = [
'showMaskOnHover' => false,
'oncomplete' => new JsExpression('function(){ alert("inputmask complete");}'),
];
$clientOptions = [
'onMaskChange' => new JsExpression('function(maskObj, completed) {console.log(maskObj, completed);}')
];
// without model
echo MaskedPhoneInput::widget([
'name' => 'my-input-name',
'inputmaskClientOptions' => $inputmaskOptions,
'clientOptions' => $clientOptions,
]);
// with model
echo $form->field($model, 'title')
->widget(
MaskedPhoneInput::className(),
[
'inputmaskClientOptions' => $inputmaskOptions,
'clientOptions' => $clientOptions,
]
);