2017 © Pedro Peláez
 

yii2-extension yii2-thumbnail

Yii2 helper for creating and caching thumbnails on real time

image

alkurn/yii2-thumbnail

Yii2 helper for creating and caching thumbnails on real time

  • Tuesday, May 15, 2018
  • by ganesh.alkurn
  • Repository
  • 1 Watchers
  • 0 Stars
  • 150 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 18 % Grown

The README.md

Thumbnail Image Helper for Yii2

Yii2 helper for creating and caching thumbnails on real time., (*1)

Installation

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

  • Either run
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)

  • Add a new lines in 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');
  • Add a new component in 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)

Usage

For example:, (*7)

use alkurn\thumbnail\ThumbnailImage;

echo ThumbnailImage::thumbnailImg(
    $model->image,
    50,
    50,
    ThumbnailImage::THUMBNAIL_OUTBOUND,
    ['alt' => $model->image]
);

The Versions

15/05 2018

dev-master

9999999-dev

Yii2 helper for creating and caching thumbnails on real time

  Sources   Download

MIT

The Requires

 

yii2 helper image thumbnail