2017 © Pedro Peláez
 

library yii2-imagecache

Image cache for yii2

image

letyii/yii2-imagecache

Image cache for yii2

  • Friday, January 22, 2016
  • by nguago
  • Repository
  • 3 Watchers
  • 7 Stars
  • 595 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 4 Forks
  • 2 Open issues
  • 3 Versions
  • 6 % Grown

The README.md

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., (*1)

Either run, (*2)

php composer.phar require "letyii/yii2-imagecache" "*"

or add, (*3)

"letyii/yii2-imagecache": "*"

to the require section of your application's composer.json file., (*4)

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" />

The Versions

22/01 2016

dev-master

9999999-dev https://github.com/letyii/yii2-imagecache

Image cache for yii2

  Sources   Download

MIT

The Requires

 

cache yii2 image thumbnail

01/09 2015

v1.0.1

1.0.1.0 https://github.com/letyii/yii2-imagecache

Image cache for yii2

  Sources   Download

MIT

The Requires

 

cache yii2 image thumbnail

26/04 2015

v1.0

1.0.0.0 https://github.com/letyii/yii2-imagecache

Image cache for yii2

  Sources   Download

MIT

The Requires

 

cache yii2 image thumbnail