A
A
Alex Meller2016-03-17 11:40:50
Yii
Alex Meller, 2016-03-17 11:40:50

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'
    ]
]);

in the about.php view as shown in the screenshot
JirWv2MBaqY.jpg
, an error pops up
o6JNsUsA6qw.jpg

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question