Skip to content

yuriimouse/yii2-popajax

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Popup with AJAX loading extension

REQUIREMENTS

It is an little extension for yii2\bootstrap\Modal

INSTALLATION

Install via Composer

If you do not have Composer, you may install it by following the instructions at getcomposer.org.

Append repository to composer.json:

    "repositories": [
        {
            "type": "git",
            "url": "https://github.com/IuriiP/yii2-popajax.git"
        }
        ],

Run update:

composer require iuriip/yii2-popajax

Usage

Add to any element:

'class' => 'modal-button',
'modal-href' => <url-to-popup-content>,
'modal-target' => <jQuery selector>,

I.e.

<?= Html::a('<span class="glyphicon glyphicon-eye-open"></span>', "#", [
            'title' => Yii::t('app', 'View'),
            'class' => 'modal-button',
            'modal-href' => $url,
            'modal-target' => '#modal'
    ]);

Then define your modal:

use iuriip\yii2\Popup;

//...
    <?php
    Popup::begin([
        'header' => 'Preview',
        'id' => 'modal',
        'size' => 'modal-lg',
        ]);

    //...

    Popup::end();
    ?>
//...

You can use a lot the different independent modals over different modal-target selector.

Todo

Append a process loading indicator

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages