toriphes / yii2-widget-lazyload
wrapper of http://www.appelsiini.net/projects/lazyload jquery library
Installs: 32 221
Dependents: 1
Suggesters: 0
Security: 0
Stars: 6
Watchers: 3
Forks: 4
Open Issues: 0
Type:yii2-extension
Requires
- bower-asset/jquery.lazyload: ~1.9
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2024-12-21 19:48:56 UTC
README
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]);