Download the PHP package letyii/yii2-imagecache without Composer
On this page you can find all versions of the php package letyii/yii2-imagecache. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package yii2-imagecache
yii2-imagecache
Features
- [x] Image resize on demand
- [x] Imagick support
- [ ] GD support
- [ ] Amazon S3 support
Installation
The preferred way to install this extension is through composer.
Either run
or add
to the require section of your application's composer.json
file.
Config
'components' => [
...
'imageCache' => [
'class' => 'letyii\imagecache\imageCache',
'cachePath' => '@app/uploads/cache',
'cacheUrl' => '@web/uploads/cache',
],
]
Usage Example
echo Yii::$app->imageCache->imgSrc('@app/uploads/test.jpg', 'x200');
// Output: /your-app/uploads/cache/x200/.../test.jpg
echo Yii::$app->imageCache->img('@app/uploads/test.jpg', '100x');
// Output: <img src="/your-app/uploads/cache/100x/.../test.jpg" alt="" />
echo Yii::$app->imageCache->img('@app/uploads/test.jpg', '100x150', ['class'=>'test', 'alt' => 'Test image']);
// Output: <img src="/your-app/uploads/cache/100x120/.../test.jpg" alt="" class="img" alt="Test image" />
All versions of yii2-imagecache with dependencies
PHP Build Version
Package Version
The package letyii/yii2-imagecache contains the following files
Loading the files please wait ....