Pages

Showing posts with label cake. Show all posts
Showing posts with label cake. Show all posts

Sunday, June 9, 2013

Cakephp-using Timthumb in cakephp

Using TimThumb in cakephp

Timthumb library is used to generated required sized images on the fly..it produces images of required size which are stored in its cache as such page is loaded much faster...

Timthumb can be easily downloaded from

http://timthumb.googlecode.com/svn/trunk/timthumb.php

Download the file and place it in

/webroot/files/timthumb.php

create a folder called cache with permissions "777" under the same folder.

now use the following code to echo images via timthumb

 echo $this->Html->image('/files/timthumb.php?src='.WWW_ROOT.'/img/imgname.jpg&w=63&h=63');  


this will convert any size image to 63X63 on the fly...you see more options of this library to make a better use of the same.