dev-master
9999999-devYii2 helper for creating and caching thumbnails on real time
MIT
The Requires
by Ganesh
yii2 helper image thumbnail
Wallogit.com
2017 © Pedro Peláez
Yii2 helper for creating and caching thumbnails on real time
Yii2 helper for creating and caching thumbnails on real time., (*1)
The preferred way to install this extension is through composer., (*2)
php composer.phar require --prefer-dist "alkurn/yii2-thumbnail" "dev-master"
or add, (*3)
"alkurn/yii2-thumbnail" : "*"
to the require section of your application's composer.json file., (*4)
bootstrap file of your application, for example:Yii::setAlias('@uploads', dirname(dirname(__DIR__)) . '/uploads');
Yii::setAlias('@cache', dirname(dirname(__DIR__)) . '/uploads/cache');
Yii::setAlias('@image', '/uploads/cache');
components section of your application's configuration file (optional), for example:'components' => [
'thumbnail' => [
'class' => 'alkurn\thumbnail\Thumbnail',
'cacheAlias' => Yii::getAlias('@cache/'),
'uploadsAlias' => Yii::getAlias('@uploads/'),
'imageAlias' => Yii::getAlias('@image/'),
'defaultImage' => 'default.png',
],
],
and in bootstrap section, for example:, (*5)
'bootstrap' => ['log', 'thumbnail'],
It is necessary if you want to set global helper's settings for the application., (*6)
For example:, (*7)
use alkurn\thumbnail\ThumbnailImage;
echo ThumbnailImage::thumbnailImg(
$model->image,
50,
50,
ThumbnailImage::THUMBNAIL_OUTBOUND,
['alt' => $model->image]
);
Yii2 helper for creating and caching thumbnails on real time
MIT
yii2 helper image thumbnail