The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist maddoger/yii2-imagecache "*"
or add
"maddoger/yii2-imagecache": "*"
to the require section of your composer.json
file.
'imageCache' => [
'class' => 'maddoger\imagecache\ImageCache',
'generateWithUrl' => false,
'actionSavesFile' => false,
//Avatar
'presets' => [
'100x100' => [
'fit' => [
'width' => 100,
'height' => 100,
],
],
'200x' => [
'thumbnail' => [
'width' => 200,
'height' => 200,
],
],
],
],
public function actions()
{
return [
'imagecache' => [
'class' => 'maddoger\imagecache\ImageAction',
],
];
}
'urlManager' => [
...
'rules' => [
...
'static/ic/<img:.*?>' => 'site/imagecache',
...
],
...
],
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]
Use files from server folder.
For faster generation you may use file in server folder (.htaccess and generator script), or another methods.
Comments