Download the PHP package assayer-pro/yii2-easy-thumbnail-image-helper without Composer
On this page you can find all versions of the php package assayer-pro/yii2-easy-thumbnail-image-helper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download assayer-pro/yii2-easy-thumbnail-image-helper
More information about assayer-pro/yii2-easy-thumbnail-image-helper
Files in assayer-pro/yii2-easy-thumbnail-image-helper
Package yii2-easy-thumbnail-image-helper
Short Description Yii2 helper for creating and caching thumbnails on real time
License MIT
Informations about the package yii2-easy-thumbnail-image-helper
Easy Thumbnail Image Helper for Yii2
Yii2 helper for creating and caching thumbnails on real time.
Installation
The preferred way to install this extension is through composer.
- Either run
or add
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:
It is necessary if you want to set global helper's settings for the application.
Usage
For example:
or
If one of thumbnail dimensions is set to null, another one is calculated automatically based on aspect ratio of original image. Note that calculated thumbnail dimension may vary depending on the source image in this case.
If both dimensions are specified, resulting thumbnail would be exactly the width and height specified. How it's achieved depends on the mode.
For other functions please see the source code.
If you want to handle errors that appear while converting to thumbnail by yourself, please make your own class and inherit it from EasyThumbnailImage. In your class replace only protected method errorHandler. For example
All versions of yii2-easy-thumbnail-image-helper with dependencies
yiisoft/yii2-httpclient Version ~2.0.0
yiisoft/yii2-imagine Version *