PHP code example of andrew72ru / yii2-ion-range-slider

1. Go to this page and download the library: Download andrew72ru/yii2-ion-range-slider library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

andrew72ru / yii2-ion-range-slider example snippets


use andrew72ru\ionrange\Slider;

<?= $form->field($model, 'attribute')->widget(Slider::className(), [
    'options' => [] // Html tag options
    'clientOptions' => [
        'type'  => 'double', // Slider type
        'grid'  => true,     // Whether is grid of values enabled or not
        'min'   => 0,        // min slider value
        'max'   => 100,      // max slider value
        'from'  => 10,       // start position for left handle
        'to'    => 90,       // start position for right handle
    ],
    'clientEvents' => [
        'onStart'  => 'function(data) { console.log(data) }',
        'onChange' => 'function(data) { console.log(data) }',
        'onFinish' => 'function(data) { console.log(data) }',
        'onUpdate' => 'function(data) { console.log(data) }',
    ]
]);