webllc / yii2-image-optimizer
The image optimizer integration for the Yii framework
Installs: 7
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
Type:yii2-extension
Requires
- php: ^7.1
- webllc/image-optimizer: ^2.1.0
- yiisoft/yii2: ~2
This package is auto-updated.
Last update: 2024-04-14 23:24:41 UTC
README
A Yii2 helper for optimizing image using webllc/image-optimizer library.
Installation
- Run the Composer command to install the latest version:
composer require webllc/yii2-image-optimizer
Usage
From here, you could either use it directly like this:
\webllc\yii2\ImageOptimizer\Optimizer::optimize('@app/image.png');
And like this:
use \webllc\yii2\ImageOptimizer\Optimizer; Optimizer::optimize('@app/image.png');
Or, define it as Yii2 component. At your config:
'components' => [ 'optimizer' => [ 'class' => 'webllc\yii2\ImageOptimizer\Optimizer', ], ],
Then use it like this:
Yii::$app->optimizer::optimize('@app/image.png');