Skip to content

Instantly share code, notes, and snippets.

@gabrielslau
gabrielslau / ThumbnailHelper.php
Created March 8, 2012 17:16
Controller para redimensionamento e Upload de imagems (e/ou arquivos diversos)
<?php
/**
* Helper to generate thumbnail images dynamically by saving them to the cache.
* Alternative to phpthumb.
*
* Esta classe foi adaptada para o uso da classe VEROT para manipulação das imagens (por Gabriel Lau)
*
* Inspired in http://net.tutsplus.com/tutorials/php/image-resizing-made-easy-with-php/
*
* @author Emerson Soares (dev.emerson@gmail.com)
public function view($id = null) {
$this->Noticia->id = $id;
if (!$this->Noticia->exists()) {
throw new NotFoundException(__('Invalid noticia'));
}
$this->set('noticia', $this->Noticia->read(null, $id));
}
public function view($id = null) {
$this->Noticia->id = $id;
if (!$this->Noticia->exists()) {
throw new NotFoundException(__('Invalid noticia'));
}
$this->set('noticia', $this->Noticia->read(null, $id));
}