PHP code example of it-for-free / yii-image-resize-on-the-fly

1. Go to this page and download the library: Download it-for-free/yii-image-resize-on-the-fly 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/ */

    

it-for-free / yii-image-resize-on-the-fly example snippets


Yii::setAlias('@uploadPath', dirname(dirname(__DIR__)) . '/frontend/web/uploads');

use ItForFree\YiiImageResizeOnTheFly\Image;
....
....

'modules' => [
    'image' => [
        'class' => Image::class,
        'baseUploadPath' => '@uploadPath'
    ], 
],                                                                                 

echo imgrsc($path, $format, $options);

echo imgrsc($model->img, '100x100');