Awimage Image Optimizer CDN Widget
this widget is prepared to be used with Awimage services, right now on testing stage, if you want to be part and help us test it please let us know at awimage@coderteams.com.
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist awimage/yii2-image-optimizer-cdn "*"
or add
"awimage/yii2-image-optimizer-cdn": "*"
to the require section of your composer.json
file.
Once the extension is installed, simply use it in your code by:
<?= \awimage\imageOptimizer\Img::widget([
'src' => 'https://www.yourdomain.com/yourimage.jpg',
'MaxWidthForMobile' => '460',
'MaxWidthForTablet' => '760',
'MaxWidthForDesktop' => '1280',
'options' => [
'alt' => 'Your super awesome alternative text'
]
]); ?>
```