awimage / yii2-image-optimizer-cdn
Awimage Image Optimizer CDN Widget
Installs: 967
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 3
Open Issues: 1
Type:yii2-extension
Requires
README
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' ] ]); ?> ```