Answer the question
In order to leave comments, you need to log in
How to install widget for Yii?
Installed Yii standard basic, installed the widget itself ( demos.krajee.com/slider) inserted the code
// Basic horizontal slider with ActiveForm. Check the model validation for values
// > 5 or < 1. You can also use arrow keys to navigate.
echo $form->field($model, 'rating')->widget(Slider::classname(), [
'pluginOptions'=>[
'min'=>0,
'max'=>20,
'step'=>1
]
]);
// Style your slider selection and handle colors and choose your handle type.
// Set a preselected value. Set the tooltip to be always displayed.
echo Slider::widget([
'name'=>'rating_1',
'value'=>7,
'sliderColor'=>Slider::TYPE_GREY,
'handleColor'=>Slider::TYPE_DANGER,
'pluginOptions'=>[
'handle'=>'triangle',
'tooltip'=>'always'
]
]);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question