awimage/yii2-image-optimizer-cdn

Awimage Image Optimizer CDN Widget

1.0.5 2021-03-13 15:15 UTC

This package is auto-updated.

Last update: 2024-04-23 09:30:20 UTC


README

Latest Stable Version Total Downloads

Awimage Image Optimizer CDN Widget

Service.

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.

Installation

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.

Usage

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'
        ]
      ]); ?>
    ```