PHP code example of webllc / yii2-image-optimizer

1. Go to this page and download the library: Download webllc/yii2-image-optimizer library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

webllc / yii2-image-optimizer example snippets


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

use \webllc\yii2\ImageOptimizer\Optimizer;

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

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

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