2017 © Pedro Peláez
 

yii2-extension yii2-imgcache

The lireincore/imgcache integration for the Yii2 framework

image

lireincore/yii2-imgcache

The lireincore/imgcache integration for the Yii2 framework

  • Monday, May 7, 2018
  • by lireincore
  • Repository
  • 0 Watchers
  • 4 Stars
  • 85 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 4 Versions
  • 25 % Grown

The README.md

Image effect, thumb and cache extension for Yii2

Latest Stable Version Total Downloads License, (*1)

About

The lireincore/imgcache integration for Yii2 framework., (*2)

Install

Add the "lireincore/yii2-imgcache": "^0.6" package to your require section in the composer.json file, (*3)

or, (*4)

``` bash $ php composer.phar require lireincore/yii2-imgcache, (*5)


## Usage To use this extension, you need to create the `imgcache.php` file in your `config` folder and add this code: ```php <?php return [ 'srcdir' => '@app/files/images', 'destdir' => '@webroot/thumbs', 'webdir' => '@webroot', 'baseurl' => '@web', //.... 'presets' => [ 'origin' => [ 'effects' => [ //add the effects you need //.... ], ], ], ];

See lireincore/imgcache README.md for more information about the available effects and other config options., (*6)

Also add the following code in your Yii2 application configuration:, (*7)

$config = [
    //....
    'container' => [
        //....
        'singletons'  => [
            //....
            LireinCore\Yii2ImgCache\ImgCache::class => [
                ['class' => LireinCore\Yii2ImgCache\ImgCache::class],
                [
                    require(__DIR__ . '/imgcache.php'),
                ]
            ],
        ]
    ],
];

Use in your code:, (*8)

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');

See lireincore/imgcache README.md for more information about the available functions., (*9)

License

This project is licensed under the MIT License - see the License File file for details, (*10)

The Versions

07/05 2018

dev-master

9999999-dev https://github.com/lireincore/yii2-imgcache

The lireincore/imgcache integration for the Yii2 framework

  Sources   Download

MIT

The Requires

 

by lirein

cache filter yii2 image resize action thumb effect preset

07/05 2018

0.2.1

0.2.1.0 https://github.com/lireincore/yii2-imgcache

The lireincore/imgcache integration for the Yii2 framework

  Sources   Download

MIT

The Requires

 

by lirein

cache yii2 image resize thumb effect preset

26/04 2018

0.2.0

0.2.0.0 https://github.com/lireincore/yii2-imgcache

The lireincore/imgcache integration for the Yii2 framework

  Sources   Download

MIT

The Requires

 

by lirein

cache filter yii2 image resize action thumb effect

26/04 2018

0.1.0

0.1.0.0 https://github.com/lireincore/yii2-imgcache

The imgcache integration for the Yii2 framework

  Sources   Download

MIT

The Requires

 

by lirein

cache filter yii2 image resize action thumb effect