An advanced slider input for Yii Framework 2 for both touch enabled and desktop devices based on bootstrap-slider.
An advanced slider input for Yii Framework 2 based on seiyria/bootstrap-slider plugin, which is a fork of the bootstrap-slider by Stefan Petre from eyecon.ru. The slider input offers these advanced features
- vertical or horizontal orientation of slider
- setup your minimum and maximum values
- setup your step increments
- range selector (multiple handles to control the range)
- three shapes for handles
- touch capablity and support for touch devices
Additional enhancements added for this widget (by Krajee):
- allows to configure slider selection and handle colors.
- preselected styles to color your slider and handles.
- automatically trigger change of base field on slider stop to enforce Yii ActiveField validation
- automatically set plugin options based on base field value (parse array input value for range)
- automatically disable slider based on disabled/readonly options.
You can see detailed documentation on usage of the extension.
Refer the CHANGE LOG for details on updates to various releases.
The preferred way to install this extension is through composer.
$ php composer.phar require kartik-v/yii2-slider "dev-master"
require section of your
use kartik\slider\Slider; echo Slider::widget([ 'name' => 'slider', 'sliderColor' => Slider::TYPE_DANGER, 'handleColor' => Slider::TYPE_DANGER, 'pluginOptions' => [ 'orientation' => 'horizontal', 'handle' => 'round', 'min' => 0, 'max' => 255, 'step' => 1 ], ]);
yii2-slider is released under the BSD-3-Clause License. See the bundled
LICENSE.md for details.