scorpsan / bootstrap-select
Yii2 Bootstrap Select Asset.
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- bower-asset/bootstrap-select: *
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2025-04-18 05:10:27 UTC
README
Позволяет использовать стилизованные выпадающие списки. Плагин мультиязычный, поэтому установите язык в своем приложении.
Installation
The preferred way to install this extension through composer.
You can set the console
$ composer require "scorpsan/bootstrap-select"
or add
"scorpsan/bootstrap-select": "*"
in require
section in composer.json
file.
Using
Once the extension is installed, simply use it in your code by :
Add following code to your configuration file of application:
<?php ... use phpnt\bootstrapSelect\BootstrapSelectAsset; ... BootstrapSelectAsset::register($this); ... echo $form->field($model, 'id')->dropDownList($items, [ 'class' => 'form-control selectpicker', 'data' => [ 'style' => 'btn-success', 'live-search' => false, 'size' => 7, 'title' => 'Choose one...' ]]); echo $form->field($model, 'id')->dropDownList($items, [ 'class' => 'form-control selectpicker', 'data' => [ 'style' => 'btn-primary', 'live-search' => true, 'size' => 7, 'title' => 'Choose one...', ], ]); echo $form->field($model, 'id')->dropDownList($items, [ 'class' => 'form-control selectpicker', 'multiple' => true, 'data' => [ 'style' => 'btn-warning', 'live-search' => false, 'size' => 7, ], ]); echo Html::dropDownList('item', null, $items, [ 'class' => 'form-control selectpicker', 'data' => [ 'style' => 'btn-info', 'live-search' => false, 'size' => 7, 'title' => 'Choose one...', ] ]); echo Html::dropDownList('item', null, $items, [ 'class' => 'form-control selectpicker', 'data' => [ 'style' => 'btn-default', 'live-search' => true, 'size' => 7, 'title' => 'Choose one...', ] ]); ... ?>