Skip to content

rootlocal/yii2-select2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yii2-select2

Yii2 Select2 widget

Latest Stable Version

Install

composer require rootlocal/yii2-select2

or add

"rootlocal/yii2-select2": "dev-master"

to the require section of your composer.json.

Basic usage:

<?php
use yii\web\View;
use yii\bootstrap4\ActiveForm;
use rootlocal\widgets\select2\Select2Widget;

/**
 * @var View $this
 * @var ActiveForm $form 
 */
?>

<?= $form->field($model, 'attribute')->widget(Select2Widget::class,['items'=> $model->getItems()]) ?>