yii-ui/yii2-materialize-select2

Select2 Widget for Yii 2 with Materialize styles

Installs: 106

Dependents: 6

Suggesters: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 2

Language:CSS

Type:yii2-extension

v1.1.2 2018-07-04 11:57 UTC

README

Latest Stable Version Total Downloads Maintainability Yii2 License

This is an Yii framework 2.0 widget of the Select2 replacement for select boxes with styles for the Materialize CSS Framework.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require yii-ui/yii2-materialize-select2

or add

"yii-ui/yii2-materialize-select2": "~1.1.0"

to the require section of your composer.json file.

Usage

as active form element:

use yiiui\yii2materializeselect2\Select2:

echo $form->field($model, 'attribute')->widget(Select2::class, [
    'items' => [1 => 'Apple', 2 => 'Banana'],
    'options' => [
        'placeholder' => 'Select your favourite',
    ],
    'clientOptions' => [
        'allowClear' => true
    ],
]);

or as widget:

Select2::widget([
    'name' => 'input-name',
    'value' => 2,
    'items' => [1 => 'Apple', 2 => 'Banana'],
    'options' => [
        'placeholder' => 'Select your favourite',
    ],
    'clientOptions' => [
        'allowClear' => true
    ],
]);

More Examples will be added soon at https://www.yii-ui.com/yii2-materialize-select2. For plugin configuration see Select2 Documentation.

Documentation

Documentation will be added soon at https://www.yii-ui.com/yii2-materialize-select2.

License

yii2-materialize-select2 is released under the MIT License. See the LICENSE.md for details.