PHP code example of quexer69 / yii-slit-slider

1. Go to this page and download the library: Download quexer69/yii-slit-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/ */

    

quexer69 / yii-slit-slider example snippets


'modules' => array(
        'slitSlider' => array(
            'class' => 'vendor.quexer69.yii-slit-slider.SlitSliderModule',
            'imagePresets' => array(
                'slitSlider-crop-16-9-jpg' => 'Picture 16:9 cropped 2000x700px (JPG)',
                'slitSlider-crop-16-9-png' => 'Picture 16:9 cropped 2000x700px (PNG)',
            ),
        ),
        ...
        'p3media' => array(
            'class' => 'vendor.phundament.p3media.P3MediaModule',
            'params' => array(
                ...
                'presets' => array(
                    ...
                    'slitSlider-crop-16-9-jpg' => array(
                            'name' => 'Picture 16:9 cropped 2000x700px (JPG)',
                            'commands' => array(
                                'resize' => array(2000, 700, 7), // crop
                                'quality' => '85',
                            ),
                            'type' => 'jpg',
                    ),
                    'slitSlider-crop-16-9-png' => array(
                            'name' => 'Picture 16:9 cropped 2000x700px (PNG)',
                            'commands' => array(
                                'resize' => array(2000, 700, 7), // crop
                                'quality' => '85',
                            ),
                            'type' => 'png',
                    ),
                    ...
                ),
            ),
        ),

'migrate' => array(
        'modulePaths' => array(
            ...
            'slitSlider' => 'vendor.quexer69.yii-slit-slider.migrations',
            ...
            ),
        ),

'themeManager' => array(
            'class' => 'vendor.schmunk42.multi-theme.EMultiThemeManager',
            'basePath' => $applicationDirectory . '/themes',
            'baseUrl' => $baseUrl . '/themes',
            'rules' => array(
                ...
                '^slitSlider/(.*)' => 'backend2',
                ...
            )
        ),


    $this->widget('slitSlider.components.SlitSliderWidget');



    $this->widget(
       'vendor.quexer69.yii-slit-slider.SlitSliderWidget',
           array(
               'orientation'   => 'horizontal',    // default orientation if slit has no orientation set
               'imagePreset'   => 'slitslider',    // P3Media image preset for pictures
               'order'         => 'rank DESC',     // sort order of the slits
               'scaleable'     => '1',             // responsive or defined height and width
               'groupId'       => NULL,            // show all slits for a group_id
               'max_width'     => '2000px',        // needed for scalabel = 1 (true)
               'width'         => '100%',          // css width of the wrapper
               'height'        => '500px',         // can be set on scalabel = 0 (false)
           )
    );


'p3widgets' => array(
        'params' => array(
            'widgets' => array(
                ...
                'slitSlider.components.SlitSliderWidget' => 'SlitSlider'
        ),
        ...

    $this->widget('p3widgets.components.P3WidgetContainer',
        array(
            'id' => 'slitSlider',
            'varyByRequestParam' => P3Page::PAGE_ID_KEY
        )
    );