philippfrenzel/yii2bsduallistbox

Yii2 Bootstrap Duallistbox 小部件

0.1.1 2017-02-05 20:00 UTC

This package is not auto-updated.

Last update: 2024-09-23 13:08:01 UTC


README

yii2 bootstrap-duallistbox 的封装: https://github.com/istvan-ujjmeszaros/bootstrap-duallistbox

关于插件选项,请访问插件创建者的网站

philipp@frenzel.net 开发的 Yii2 扩展

Latest Stable Version Build Status Code Climate Version Eye License

安装

尽管在 packagist.org 上注册了包 - 因此您只需添加一行代码即可运行它!

在您的 composer.json 的 require 部分添加以下行

  "philippfrenzel/yii2bsduallistbox":"*",

或者运行

$ php composer.phar require philippfrenzel/yii2bsduallistbox "*"

并确保您已全局安装以下插件

php composer.phar global require "fxp/composer-asset-plugin:~1.0"

变更日志

2017-04-02 初始上传

使用方法

快速入门看起来像这样

use net\frenzel\yii2bsduallistbox\yii2bsduallistbox;
...
<?php
    
    $options = [
        'multiple' => true,
        'size' => 20,
    ];

    // echo Html::listBox($name, $selection, $items, $options);
    echo yii2bsduallistbox::widget([
        'name' => $name,
        'selection' => $selection,
        'items' => $items,
        'options' => $options,
        'clientOptions' => [
            'moveOnSelect' => false,
            'selectedListLabel' => 'Selected Items',
            'nonSelectedListLabel' => 'Available Items',
        ],
    ]);
?>