2amigos/yii2-select2-widget
最新稳定版本:0.1.2
Composer 安装命令:
composer require 2amigos/yii2-select2-widget
包简介
Select 2 jQuery plugin for Yii2 with Bootstrap theme capabilities
README 文档
README
Select2 gives you a customizable select box with support for searching, tagging, remote data sets, infinite scrolling, and many other highly used options.
Install
Via Composer
$ composer require 2amigos/yii2-select2-widget
Usage
The Widget comes in two flavors, one for the classic and the bootstrap. The widgets, apart from the bootstrap one that
requires some tweaks, are mostly configured throughout the clientOptions and clientEvents. Attributes that hold the
configuration of the plugin and its events respectively.
For that reason, we highly recommend you to visit the Select2 Documentation for the possible options available on Select2 and Select2 Bootstrap Theme to check all the possible display options regarding Select2 with this theme.
Note We are in the process to create a website that will demo all our widgets, including this. The following are some basic samples to get you started. On the website, demos will be extensive and showing all possible configuration options.
Using Select2Widget
use dosamigos\select2\Select2: // with \yii\bootstrap\ActiveForm; echo $form ->field($model, 'attribute') ->widget( Select2::class, [ 'items' => $data, // $data should be the same as the items provided to a regular yii2 dropdownlist 'clientOptions' => ['theme' => 'classic'] ] ); // as widget echo Select2::widget([ 'name' => 'my-name', 'value' => 'my-value', 'clientOptions' => [ 'maximumInputLength' => 20 ] ]);
Using Select2BootstrapWidget
use dosamigos\select2\Select2Bootstrap: // displaying the select2 with prepended addon echo $form ->field($model, 'attribute') ->widget( Select2Bootstrap::class, [ 'items' => $data, // $data should be the same as the items provided to a regular yii2 dropdownlist 'template' => '<div class="input-group">' . '<span class="input-group-btn">' . '<button class="btn btn-default" type="button" data-select2-open="multi-prepend-append">' . 'State' . '</button>' . '</span>' . '{input}' . '<span class="input-group-addon">Append</span>' . '</div>' ] ); // as widget echo Select2Bootstrap::widget([ 'name' => 'my-name', 'value' => 'my-value', 'clientOptions' => [ 'maximumInputLength' => 20 ] ]);
Testing
$ phpunit
Using code fixer
We have added a PHP code fixer to standardize our code. It includes Symfony, PSR2 and some contributors rules.
./vendor/bin/php-cs-fixer fix ./src --config .php_cs
Contributing
Please see CONTRIBUTING for details.
Credits
License
The BSD License (BSD). Please see License File for more information.
Custom Software | Web & Mobile Development
www.2amigos.us
2amigos/yii2-select2-widget 适用场景与选型建议
2amigos/yii2-select2-widget 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 183.37k 次下载、GitHub Stars 达 7, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「jquery」 「plugin」 「form」 「extension」 「widget」 「select2」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 2amigos/yii2-select2-widget 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 2amigos/yii2-select2-widget 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 2amigos/yii2-select2-widget 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
CakePHP 4.x AdminLTE Theme.
Yii2 LightBox image galary widget uses Lightbox v2.10.0 by Lokesh Dhakar
Diese Contao 4 Erweiterung stellt Google reCAPTCHA V2 in Form eines neuen Formularfeldes im Formulargenerator bereit. This extension provides Google reCAPTCHA V2 in the form of a new form field in the form generator of Contao Open Source CMS.
A Laravel Filament Forms slug field.
This is a laravel 4 package for the server and client side of datatables at http://datatables.net/
A jQuery augmented PHP library for creating and validating HTML forms
统计信息
- 总下载量: 183.37k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 29
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 未知