2017 © Pedro Peláez
 

yii2-extension yii2-select2-widget

Select 2 jQuery plugin for Yii2 with Bootstrap theme capabilities

image

2amigos/yii2-select2-widget

Select 2 jQuery plugin for Yii2 with Bootstrap theme capabilities

  • Wednesday, July 26, 2017
  • by tonydspaniard
  • Repository
  • 3 Watchers
  • 4 Stars
  • 1,007 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 8 Versions
  • 21 % Grown

The README.md

Select2 Widget for Yii2

Latest Version Software License Build Status Coverage Status Quality Score Total Downloads, (*1)

Select2 gives you a customizable select box with support for searching, tagging, remote data sets, infinite scrolling, and many other highly used options., (*2)

Install

Via Composer, (*3)

$ composer require 2amigos/yii2-select2-widget

Usage

The Widget comes in two flavors, one for the classic and the bootstrap. The widgets, apart from the bootstrap one that requires some tweaks, are mostly configured throughout the clientOptions and clientEvents. Attributes that hold the configuration of the plugin and its events respectively., (*4)

For that reason, we highly recommend you to visit the Select2 Documentation for the possible options available on Select2 and Select2 Bootstrap Theme to check all the possible display options regarding Select2 with this theme., (*5)

Note We are in the process to create a website that will demo all our widgets, including this. The following are some basic samples to get you started. On the website, demos will be extensive and showing all possible configuration options., (*6)

Using Select2Widget

use dosamigos\select2\Select2:


// with \yii\bootstrap\ActiveForm;
echo $form
    ->field($model, 'attribute')
    ->widget(
        Select2::class, 
        [
            'items' => $data, // $data should be the same as the items provided to a regular yii2 dropdownlist
            'clientOptions' => ['theme' => 'classic']
        ]
    );

// as widget 
echo Select2::widget([
    'name' => 'my-name',
    'value' => 'my-value',
    'clientOptions' => [
        'maximumInputLength' => 20
    ]
]); 

Using Select2BootstrapWidget

use dosamigos\select2\Select2Bootstrap:

// displaying the select2 with prepended addon
echo $form
    ->field($model, 'attribute')
    ->widget(
        Select2Bootstrap::class, 
        [
            'items' => $data, // $data should be the same as the items provided to a regular yii2 dropdownlist
            'template' => '

' . '' . '' . '' . '{input}' . 'Append' . '
' ] ); // as widget echo Select2Bootstrap::widget([ 'name' => 'my-name', 'value' => 'my-value', 'clientOptions' => [ 'maximumInputLength' => 20 ] ]);

Testing

$ phpunit

Using code fixer

We have added a PHP code fixer to standardize our code. It includes Symfony, PSR2 and some contributors rules., (*7)

./vendor/bin/php-cs-fixer fix ./src --config .php_cs

Contributing

Please see CONTRIBUTING for details., (*8)

Credits

License

The BSD License (BSD). Please see License File for more information., (*9)


Custom Software | Web & Mobile Development
www.2amigos.us

The Versions

26/07 2017

dev-master

9999999-dev https://github.com/2amigos/yii2-select2-widget

Select 2 jQuery plugin for Yii2 with Bootstrap theme capabilities

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

plugin extension yii2 jquery form 2amigos widget select2 dropdown

26/07 2017

0.1.2

0.1.2.0 https://github.com/2amigos/yii2-select2-widget

Select 2 jQuery plugin for Yii2 with Bootstrap theme capabilities

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

plugin extension yii2 jquery form 2amigos widget select2 dropdown

26/07 2017

0.1.1

0.1.1.0 https://github.com/2amigos/yii2-select2-widget

Select 2 jQuery plugin for Yii2 with Bootstrap theme capabilities

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

plugin extension yii2 jquery form 2amigos widget select2 dropdown

26/07 2017

0.1.0

0.1.0.0 https://github.com/2amigos/yii2-select2-widget

Select 2 jQuery plugin for Yii2 with Bootstrap theme capabilities

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

plugin extension yii2 jquery form 2amigos widget select2 dropdown

26/07 2017

0.0.3

0.0.3.0 https://github.com/2amigos/yii2-select2-widget

Select 2 jQuery plugin for Yii2 with Bootstrap theme capabilities

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

plugin extension yii2 jquery form 2amigos widget select2 dropdown

26/07 2017

0.0.2

0.0.2.0 https://github.com/2amigos/yii2-select2-widget

Select 2 jQuery plugin for Yii2 with Bootstrap theme capabilities

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

plugin extension yii2 jquery form 2amigos widget select2 dropdown

26/07 2017

dev-id_fix

dev-id_fix https://github.com/2amigos/yii2-select2-widget

Select 2 jQuery plugin for Yii2 with Bootstrap theme capabilities

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

plugin extension yii2 jquery form 2amigos widget select2 dropdown

20/07 2017

0.0.1

0.0.1.0 https://github.com/2amigos/yii2-select2-widget

Select 2 jQuery plugin for Yii2 with Bootstrap theme capabilities

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

plugin extension yii2 jquery form 2amigos widget select2 dropdown