Skip to content
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.

yii-ui/yii2-materialize-select2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yii UI Select2 Widget for Yii 2 with Materialize styles

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.