scorpsan/bootstrap-select

Yii2 Bootstrap Select Asset.

Installs: 2

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:yii2-extension

1.0.0 2018-07-03 16:18 UTC

This package is not auto-updated.

Last update: 2024-06-14 01:14:13 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...',
    ]
]);

...
?>