PHPackages                             drishu/yii2-imagecache - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. drishu/yii2-imagecache

ActiveYii2-extension[Image &amp; Media](/categories/media)

drishu/yii2-imagecache
======================

the better image cache

1.0.6(10y ago)158GNU-2.0PHP

Since Jul 2Pushed 10y ago2 watchersCompare

[ Source](https://github.com/drishu/yii2-imagecache)[ Packagist](https://packagist.org/packages/drishu/yii2-imagecache)[ RSS](/packages/drishu-yii2-imagecache/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (7)Used By (0)

Yii2 Imagecache
===============

[](#yii2-imagecache)

the better image cache

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist drishu/yii2-imagecache "*"

```

or add

```
"drishu/yii2-imagecache": "*"

```

to the require section of your `composer.json` file.

### *imageCache* component config

[](#imagecache-component-config)

You should add *imageCache* component in your application configuration :

```
$config = [
    'components' => [
      ...
      'imagecache' => [
        'class' => 'drishu\yii2imagecache\ImageCache',
        // the below paths depend very much on your image upload setup
        'sourcePath' => Yii::getAlias('@base'), // base path to your uploads dir
        'cachePath' => '/data', // relative path to your uploads dir
      ],
      ...
    ],
];
```

Usage
-----

[](#usage)

In your view, controller, component, etc. just call :

```
