Skip to content

A simple plugin to resize image on the fly using a Helper

Notifications You must be signed in to change notification settings

cargan/CakePHP-ImageHelper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

CakePHP Image Helper

The main goal of this plugin is to give you the ability to resize an image without headache.

Requirements

  • CakePHP 2.x
  • PHP Gd library
  • Keyboad + Mouse

Installation

Load the plugin using bootstrap.php

CakePlugin::load('Image'); 

Usage

This plugin is a dead simple helper with only one method

$this->Image->resize('/img/avatar/1.png', 40, 40)
// Will generate a resized image /img/avatar/1_40x40.png (transparency is kept)
// will output 

<img src="/img/avatar/1_40x40.png" width="40" height="40"/>

The 4th parameter is the same than the 2nd parameter of HtmlHelper::image()

If you only want to get the "generated" image path

$this->Image->resizedUrl('/img/avatar/1.png', 40, 40); 

About

A simple plugin to resize image on the fly using a Helper

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published