PHP code example of scorpsan / bootstrap-select

1. Go to this page and download the library: Download scorpsan/bootstrap-select library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

scorpsan / bootstrap-select example snippets



...
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...',
    ]
]);

...