yiimagethumb Image Thumbnailer

  1. Requirements
  2. Install
  3. How To Use

Creates thumbnails and caches them so you don't recreate every time a page loads.

Requirements

Yii 1.1 or above

Install

Save YiimageThumb.php to protected/components

Update protected/config/main.php

'components'=>array(
    'thumb'=>array(
        'class'=>'YiimageThumb'
        ),
    .... REST OF COMPONENTS ....
),

How To Use

$image = Yii::app()->thumb->render(Yii::app()->basePath . '/../profiles/' . $model->image, array(
    'width' => '250',
        'height' => '250',
        'link' => 'true',
        'hint' => 'false',
        //'crop' => 'false',
        'sharpen' => 'true',
        'longside' => '255',
        // Any $htmlOptions that can be used in CHtml::image()
        'imgOptions' => array('class' => 'thumb_image'),
        'imgAlt' => 'Test',
    ));

echo $image;
2 0
7 followers
0 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: Others
Tags:
Developed by: cfletcher1856
Created on: Mar 29, 2013
Last updated: 5 years ago