Skip to content

rollingglory/yii2-image-optimizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Yii2 Image Optimizer

A Yii2 helper for optimizing image using spatie/image-optimizer library.

Installation

  1. Run the Composer command to install the latest version:
composer require rollingglory/yii2-image-optimizer

Usage

From here, you could either use it directly like this:

\rollingglory\ImageOptimizer\Optimizer::optimize('@app/image.png');

And like this:

use \rollingglory\ImageOptimizer\Optimizer;

Optimizer::optimize('@app/image.png');

Or, define it as Yii2 component. At your config:

'components' => [
  'optimizer' => [
    'class' => 'rollingglory\ImageOptimizer\Optimizer',
  ],
],

Then use it like this:

Yii::$app->optimizer::optimize('@app/image.png')

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages