kl83/yii2-lazy-pjax

dev-master 2019-02-11 10:39 UTC

This package is auto-updated.

Last update: 2024-11-12 04:54:58 UTC


README

When the page is generated, only empty pjax tag is included in the HTML. After the page loads, the specified view is loaded via pjax.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require kl83/yii2-lazy-pjax @dev

or add

"kl83/yii2-lazy-pjax": "@dev"

to the require section of your composer.json file.

Usage

In view:

(new LazyRender([
    'view' => 'slow-render-view', // view file
    'params' => [], // view params, optional
    'context' => null, // render context, optional
    'pjaxConfig' => [], // optional
    'getParameter' => '_lazy-pjax', // get parameter via which the rendering
                                    // command will be passed, optional
]))->render();

License

MIT License