PHP code example of eluhr / yii2-baguette-box

1. Go to this page and download the library: Download eluhr/yii2-baguette-box 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/ */

    

eluhr / yii2-baguette-box example snippets



use eluhr\baguettebox\widgets\BaguetteBox;

echo BaguetteBox::widget([
    'items' => [
        [
            '/path/to/image-0.jpg',
            'link-options' => [
                'data-caption' => 'My caption 0'
            ]
        ],
        [
            '/path/to/image-1.jpg',
            'link-options' => [
                'data-caption' => 'My caption 1'
            ]
        ],
        '/path/to/image-2.jpg',
        [
            '/path/to/image-3.jpg',
            'link-options' => [
                'data-caption' => 'My caption 2'
            ],
            'image-options' => [
                'class' => 'my-class'
            ]
        ],
        '/path/to/image-4.jpg',
        [
            '/path/to/image-6.jpg',
            'thumbnail' => '/path/to/image-6-thumbnail.jpg'
        ]
    ],
    'items_per_row' => 4,
    'plugin_options' => [
        'noScrollbars' => true
    ],
    'options' => [
        'class' => 'gallery',
    ],
    'responsive' => [
        991 => 2,
        768 => 1    
    ]
]);