2017 © Pedro Peláez
 

yii2-extension yii2-imagecache

ImageCache extension for Yii2.

image

maddoger/yii2-imagecache

ImageCache extension for Yii2.

  • Tuesday, April 14, 2015
  • by maddoger
  • Repository
  • 2 Watchers
  • 0 Stars
  • 27 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

Yii2 ImageCache by maddoger

Installation

The preferred way to install this extension is through composer., (*1)

Either run, (*2)

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

or add, (*3)

"maddoger/yii2-imagecache": "*"

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

Component:

'imageCache' => [
    'class' => 'maddoger\imagecache\ImageCache',
    'generateWithUrl' => false,
    'actionSavesFile' => false,

    //Avatar
    'presets' => [
        '100x100' => [
            'fit' => [
                'width' => 100,
                'height' => 100,
            ],
        ],
        '200x' => [
            'thumbnail' => [
                'width' => 200,
                'height' => 200,
            ],
        ],
    ],
],

For server generation

In controller:

public function actions()
    {
        return [
            'imagecache' => [
                'class' => 'maddoger\imagecache\ImageAction',
            ],
        ];
    }

In configuration:

'urlManager' => [
    ...
    'rules' => [
        ...
        'static/ic/<img:.*?>' => 'site/imagecache',
        ...
    ],
    ...
],

.htaccess

RewriteEngine On

RedirectMatch 403 /\.
RedirectMatch 403 /\.htaccess$

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^/static/ic/*
RewriteRule ^(.*)$  ../index.php [QSA,L]

Faster generation

Standalone php script

Use files from server folder., (*5)

For faster generation you may use file in server folder (.htaccess and generator script), or another methods., (*6)

The Versions

14/04 2015

dev-master

9999999-dev

ImageCache extension for Yii2.

  Sources   Download

The Requires

 

by Vitaliy Syrchikov

14/04 2015

v1.2.0

1.2.0.0

ImageCache extension for Yii2.

  Sources   Download

The Requires

 

by Vitaliy Syrchikov

30/03 2015

v1.1.1

1.1.1.0

ImageCache extension for Yii2.

  Sources   Download

The Requires

 

by Vitaliy Syrchikov

30/03 2015

v1.1

1.1.0.0

ImageCache extension for Yii2.

  Sources   Download

The Requires

 

by Vitaliy Syrchikov

10/12 2014

v1.0.1

1.0.1.0

ImageCache extension for Yii2.

  Sources   Download

The Requires

 

by Vitaliy Syrchikov

15/11 2014

v1.0.0

1.0.0.0

ImageCache extension for Yii2.

  Sources   Download

The Requires

 

by Vitaliy Syrchikov