For one value (in this case it’s not a range but only a slider of course) all is ok but when I try to use a range I don’t know how to ‘save’ the values (min, max).
You may want to read the documentation for the extension. As mentioned in the Settings section:
If you are using a range select, you need to pass the 2 range values concatenated with a , (comma). Alternatively, if you have passed a single numeric value and set pluginOptions[‘range’] to true, then pluginOptions[‘max’] will be used as the second value.
So while retrieving values, you will get a string with the 2 values separated by a comma. You can retrieve the two values using any string separation methods accordingly… for example:
// read value posted from active form to your model input
$values = explode(",", $model->slider_input_id);
// the range values can be saved in separate attributes like this
$model->range_from = $values[0]; // from part of the range
$model->range_to = $values[1]; // to part of the range
I have already read the documentation and I don’t see how to retrieve the values.
In your example, you said :
// read value posted from active form to your model input
$values = explode(",", $model->slider_input_id);
// the range values can be saved in separate attributes like this
$model->range_from = $values[0]; // from part of the range
$model->range_to = $values[1]; // to part of the range
if I try with my code, it will be :
$values = explode(",", $model->slider_years);
–> makes non sense, it would be :
$values = explode(",", $model->years);
–> gives me empty value
Strange, no ?
Perhaps, my problem is in my model declaration (I didn’t writen rules for this value)…