定制 wdmg/yii2-selectinput 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

wdmg/yii2-selectinput

最新稳定版本:1.0.9

Composer 安装命令:

composer require wdmg/yii2-selectinput

包简介

Bootstrap3 SelectInput widget for Yii2

README 文档

README

Yii2 Downloads Packagist Version Progress GitHub license

Yii2 SelectInput

SelectInput widget for Yii2

Requirements

Installation

To install the widget, run the following command in the console:

$ composer require "wdmg/yii2-selectinput"

Usage

Example of standalone widget:

<?php

use wdmg\widgets\SelectInput;
...

echo SelectInput::widget([
    'model' => $model,
    'attribute' => 'type',
    'items' => [
        'value' => 'Label',
        ...
    ],
    'options' => [
        'class' => 'form-control'
    ],
    'pluginOptions' => [
        'dropdownClass' => '.dropdown',
        'listClass' => '.dropdown-menu',
        'itemClass' => '.dropdown-item',
        'toggleClass' => '.btn .btn-default .dropdown-toggle',
        'toggleText' => 'Dropdown',
        'toggleCaret' => '<span class="caret"></span>',
        'toggleChange' => true,
        'autocomplete' => false,
        'minInput' => 2
    ]
])

?>

Example of use with ActiveForm:

<?php

use wdmg\widgets\SelectInput;
...

$form = ActiveForm::begin();
...

echo $form->field($model, 'type')->widget(SelectInput::class, [
    'items' => [
        'value' => 'Label',
        ...
    ],
    'options' => [
        'class' => 'form-control'
    ],
    'pluginOptions' => [
        'dropdownClass' => '.dropdown',
        'listClass' => '.dropdown-menu',
        'itemClass' => '.dropdown-item',
        'toggleClass' => '.btn .btn-default .dropdown-toggle',
        'toggleText' => 'Dropdown',
        'toggleCaret' => '<span class="caret"></span>',
        'toggleChange' => true,
        'autocomplete' => false,
        'minInput' => 2
    ]
]);
...

ActiveForm::end();

?>

Options

SelectInput extends InputWidget so you can use any options available for this widget. In addition, you can use these custom options if necessary:

Name Type Default Description
options array ['class' => 'form-control'] Standard options for the input widget.
pluginOptions array ['dropdownClass' => '.dropdown', 'listClass' => '.dropdown-menu', 'itemClass' => '.dropdown-item', 'toggleClass' => '.btn .btn-default .dropdown-toggle', 'toggleText' => 'Dropdown', 'toggleCaret' => '<span class="caret"></span>', 'toggleChange' => true, 'autocomplete' => false, 'minInput' => 2 Plugin SelectInput options passed to js. Read more here (https://github.com/wdmg/bootstrap-selectinput).
items array ['value' => 'Label'] Array values with labels.

Status and version

  • v.1.0.9 - Update dependencies
  • v.1.0.8 - Fixed widget ID and init after Pjax reloading
  • v.1.0.7 - Update pluginOptions and plugin version
  • v.1.0.6 - Fixed deprecated class declaration
  • v.1.0.5 - Update README.md. Update Yii2 version.

统计信息

  • 总下载量: 2.95k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 3
  • 依赖项目数: 24
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-04-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固