mitisk/yii2-phone-input

Поле для ввода телефона в формах

v1 2024-09-27 14:12 UTC

This package is auto-updated.

Last update: 2025-03-27 15:14:13 UTC


README

Stable Version License Total Downloads

Установка

Запустить

composer require mitisk/yii2-phone-input "dev-master"

или добавить в composer.json в секцию require:

"mitisk/yii2-phone-input": "dev-master"

Использование

C ActiveForm

// add this in your view
use Mitisk\Yii2PhoneInput\PhoneInput;

// Usage with ActiveForm
$form = \yii\widgets\ActiveForm::begin();

echo $form->field($model, 'phone')->widget(PhoneInput::class, [

]);

\yii\widgets\ActiveForm::end();

C моделью, без ActiveForm

// add this in your view
use Mitisk\Yii2PhoneInput\PhoneInput;

// Usage with model and without ActiveForm 
echo PhoneInput::widget([
    'model' => $model, 
    'attribute' => 'password_1'
]);

Без модели, без ActiveForm

// add this in your view
use Mitisk\Yii2PhoneInput\PhoneInput;


// Usage without a model or ActiveForm
echo PhoneInput::widget([
    'name' => 'password_2'
]);