Yii 2.0: yii2-widget-lazyload

Wrapper of lazyload jquery library
3 followers

Wrapper of lazy loading jquery library.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist toriphes/yii2-widget-lazyload "*"

or add

"toriphes/yii2-widget-lazyload": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your code by :

use toriphes\lazyload\LazyLoad;
 
echo LazyLoad::widget(['src' => 'url/to/your/image.jpg']);
 
//enable fallback for non JavaScript user
echo LazyLoad::widget(['src' => 'url/to/your/image.jpg', 'fallback' => true]);

Resources

Total 1 comment

#19683 report it
VivekYii at 2015/12/05 05:03am
Thanks for developing this type of extenstion

Thanks for developing this type of extenstion

Leave a comment

Please to leave your comment.

Create extension
Downloads
No downloadable files yet