PHP code example of toriphes / yii2-widget-lazyload
1. Go to this page and download the library: Download toriphes/yii2-widget-lazyload 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/ */
toriphes / yii2-widget-lazyload example snippets
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]);
php composer.phar