2017 © Pedro Peláez
 

yii2-extension yii2-select2

Select2 widget for Yii2 framework.

image

yii-cms/yii2-select2

Select2 widget for Yii2 framework.

  • Tuesday, March 14, 2017
  • by gonimar
  • Repository
  • 1 Watchers
  • 3 Stars
  • 4,584 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 4 Versions
  • 13 % Grown

The README.md

Select2 widget for Yii2 framework.

https://github.com/select2/select2, (*1)

    <?= $form->field($model, 'user_id')->widget(Select2::className(), [
        'items' => ArrayHelper::map(User::find()->all(), 'id', function($model) {
            return $model->username . " <{$model->email}>";
        }),
        'clientOptions' => [
            'placeholder' => 'User',
            'allowClear' => true,
        ],
        'clientEvents' => [
            'change'=>'function (e) {
                console.log("Select2 change.");
            }',
        ],
    ]) ?>
    <?= Select2::widget([
        'name' => 'InputName',
        'items' => ArrayHelper::map(User::find()->all(), 'id', function($model) {
            return $model->fio . " <{$model->email}>";
        }),
        'clientOptions' => [
            'placeholder' => 'User',
            'allowClear' => true,
        ]
    ]) ?>

The Versions

14/03 2017

dev-master

9999999-dev

Select2 widget for Yii2 framework.

  Sources   Download

The Requires

 

by Гонимар Сергей

yii2 select2

14/03 2017

v0.4

0.4.0.0

Select2 widget for Yii2 framework.

  Sources   Download

The Requires

 

by Гонимар Сергей

yii2 select2

23/11 2016

v0.3

0.3.0.0

Select2 widget for Yii2 framework.

  Sources   Download

The Requires

 

by Гонимар Сергей

yii2 select2

08/12 2015

v0.2

0.2.0.0

Select2 widget for Yii2 framework.

  Sources   Download

The Requires

 

by Гонимар Сергей

yii2 select2