yii2-easy-thumbnail-image-helper Easy thumbnail image helper for Yii2

  1. Installation
  2. Usage
  3. Resources

Yii2 helper for creating and real time caching thumbnails.

Installation

The preferred way to install this extension is through composer.

  • Either run
php composer.phar require --prefer-dist "himiklab/yii2-easy-thumbnail-image-helper" "*"

or add

"himiklab/yii2-easy-thumbnail-image-helper" : "*"

to the require section of your application's composer.json file.

  • Add a new component in components section of your application's configuration file (optional), for example:
'components' => [
    'thumbnail' => [
        'class' => 'himiklab\thumbnail\EasyThumbnail',
        'cacheAlias' => 'assets/gallery_thumbnails',
    ],
],

and in bootstrap section, for example:

'bootstrap' => ['log', 'thumbnail'],

It is necessary if you want to set global helper's settings for the application.

Usage

For example:

use himiklab\thumbnail\EasyThumbnailImage;

echo EasyThumbnailImage::thumbnailImg(
    $model->pictureFile,
    50,
    50,
    EasyThumbnailImage::THUMBNAIL_OUTBOUND,
    ['alt' => $model->pictureName]
);

For other functions please see the source code.

Resources

0 0
5 followers
0 downloads
Yii Version: 2.0
License: MIT
Category: User Interface
Developed by: himiklab
Created on: Sep 23, 2014
Last updated: 4 years ago

Related Extensions