alexeevdv/yii2-bootstrap-toggle
最新稳定版本:2.0.0
Composer 安装命令:
composer require alexeevdv/yii2-bootstrap-toggle
包简介
README 文档
README
Yii2 extension to render bootstrap toggle widget instead of checkbox.
Installation
The preferred way to install this extension is through composer.
Either run
$ php composer.phar require alexeevdv/yii2-bootstrap-toggle "~2.0"
or add
"alexeevdv/yii2-bootstrap-toggle": "~2.0"
to the require section of your composer.json file.
Usage
In active form
use alexeevdv\yii\BootstrapToggleWidget; //... echo $form->field($model, 'attribute')->widget(BootstrapToggleWidget::class); //...
Standalone widget
use alexeevdv\yii\BootstrapToggleWidget; //... BootstrapToggleWidget::widget([ 'name' => 'is_enabled', 'value' => false, ]); //...
Options
BootstrapToggleWidget::widget([ /** * Wrapper tag name. If set to false no tag will be rendered */ 'container' => 'div', /** * Wrapper HTML attributes */ 'containerOptions' => [], /** * Label when checkbox is checked */ 'labelEnabled' => 'Yes', /** * Label when checkbox is not checked */ 'labelDisabled' => 'No', /** * Value when checkbox is checked */ 'valueEnabled' => '1', /** * Value when checkbox is not checked */ 'valueDisabled' => '0', /** * Additional javascript options to Bootstrap Toggle plugin */ 'pluginOptions' => [], ]);
统计信息
- 总下载量: 3.34k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-07-14
