1. Go to this page and download the library: Download lireincore/yii2-imgcache 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/ */
use LireinCore\Yii2ImgCache\ImgCache;
$imgCache = Yii::$container->get(ImgCache::class);
// get thumb url for image '{srcdir}/blog/image.jpg' (preset 'origin')
$url = $imgcache->url('blog/image.jpg', 'origin');
// get thumb url for image '{srcdir}/blog/image.jpg' (preset 'origin')
$url = \Yii::$app->imgcache->url('blog/image.jpg', 'origin');
bash
$ php composer.phar
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.