PHP code example of jellygnite / silverstripe-sliderfield

1. Go to this page and download the library: Download jellygnite/silverstripe-sliderfield 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/ */

    

jellygnite / silverstripe-sliderfield example snippets


...
use Jellygnite\SliderField\SliderField;
...

// 0 is the minimum value, 20 is the maximum value
$fieldX = new SliderField('PositionX', 'Horizontal Offset', 0, 20);

// A vertical slider can be specified with setOrientation
$fieldY = new SliderField('PositionY', 'Vertical Offset', 0, 10);
$fieldY->setOrientation('vertical');

// Set step or increment
$fieldY->setStep(0.25);