PHP code example of awimage / yii2-image-optimizer-cdn
1. Go to this page and download the library: Download awimage/yii2-image-optimizer-cdn 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/ */
awimage / yii2-image-optimizer-cdn example snippets
<?= \awimage\imageOptimizer\Img::widget([
'src' => 'https://www.yourdomain.com/yourimage.jpg',
'MaxWidthForMobile' => '460',
'MaxWidthForTablet' => '760',
'MaxWidthForDesktop' => '1280',
'options' => [
'alt' => 'Your super awesome alternative text'
]
]);
php composer.phar