PHP code example of bigpaulie / yii2-fancybox

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

    

bigpaulie / yii2-fancybox example snippets


    use bigpaulie\fancybox\FancyBox;

    echo FancyBox::widget([
        'type' => 'image',
        'item' => [
            'href' => 'url_to_thumbnail',
            'src' => 'url_to_big_image',
        ],
    ]);

    echo FancyBox::widget([
        'type' => 'inline',
        'item' => [
            'href' => '#myInline',
            'text' => 'click here',
        ],
    ]);

    echo FancyBox::widget([
        'type' => 'ajax',
        'item' => [
            'href' => 'http://example.com/ajax.php',
            'text' => 'click here',
        ],
    ]);

    echo FancyBox::widget([
        'type' => 'ajax',
        'item' => [
            'href' => Url::to(['site/ajax']),
            'text' => 'click here',
        ],
    ]);

    echo FancyBox::widget([
        'type' => 'media',
        'item' => [
            'href' => 'https://www.youtube.com/watch?v=YE7VzlLtp-4',
            'text' => 'click here',
        ],
        'clientOptions' => [
            'helpers' => [
                'media' => true,
            ],
        ],
    ]);