Closed onmotion closed 7 years ago
This does not seem to be correct and not sure it is needed.
If you need an initial value to be set ... then just directly set it in the value
property ... e.g.
echo Slider::widget([
'name' => 'your-slider-input',
'value' => ' ', // enter your initial value
]);
If using with model just set the model attribute value to default value before initializing:
// if slider_input is the name of your model attribute
$model->slider_input = ' '; // set your input's initial value
echo Slider::widget([
'model' => $model,
'attribute' => 'slider_input'
]);
By default, the plugin has init value is 5. If my model does not have a numeric value (e.g. string '0' instead), or value is null, my slider min value will be = 5. Now you can set up any value.