yii-ui / yii2-materialize-select2
Select2 Widget for Yii 2 with Materialize styles
Installs: 742
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 2
Language:SCSS
Type:yii2-extension
Requires
- php: >=7.0.0
- bower-asset/select2: ~4.0.5
- yiisoft/yii2: ~2.0.15
This package is not auto-updated.
Last update: 2023-08-19 23:32:47 UTC
README
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.