dev-master
9999999-devHTML widget extension for Yii2 based on bootstrap-slider
The Requires
- yiisoft/yii2 ^2
- bower-asset/seiyria-bootstrap-slider *
- yiisoft/yii2-bootstrap *
by Vladislav Muschinskikh
yii2 bootstrap html widget slider
HTML widget extension for Yii2 based on bootstrap-slider
~$ composer require muvo/yii2-slider "*"
or add following string in your composer.json
into require
section:, (*1)
"muvo/yii2-slider": "*"
~$ composer update
After successful install you can use a slider as general widget in your view-files, for example:, (*2)
<div> <?=\muvo\yii\slider\Widget::widget([ 'name' => 'call_intensity', 'value' => $predefined_value, 'sliderOptions' => [ 'min' => 0.5, 'max' => 8, 'step' => 0.5, ], ])?> </div>
If you don't want to use a native boottrap assets (for example, you theme/layout already has pre-defined bootstrap), you can add useNativeBootstrap
option to your widget:, (*3)
<div class="col-sm-8"> <?=\muvo\yii\slider\Widget::widget([ 'useNativeBootstrap' => false, 'name' => 'call_intensity', 'value' => $predefined_value, … ])?> </div>
Available options, to be passed for config widget:
* id
ID for widget, will be passed to HTML-tag of widget
* name
HTML «name» attribute for HTML-input tag
* value
Predefined value for HTML-input
* sliderOptions
Array with config options, supported by slider-bootstrap, (*4)
Vladislav Muschinskikh i@unixoid.su © 2016, (*5)
HTML widget extension for Yii2 based on bootstrap-slider
yii2 bootstrap html widget slider