tags:

views:

303

answers:

2

I have an image path string stored in a database

It goes like: img/uploads/imagename.jpg

I have a controller:

$this->image = new Image($wines->image)

//this is assuming that I have a wines table with the image property

$this->image->resize(60, 250, Image::AUTO)

echo $this->image->render();

//the problem is nothing is rendered

//Is there a better way of doing this? the image path that I am passing at the Image object //instantiation is the result of a query
A: 
  1. Don't use "echo"
  2. Move the render to a view
Tihauan
A: 

You need not use the echo itself. render() itself echoes the output to the browser. Maybe, you need to use render(true), as per the document. http://docs.kohanaphp.com/libraries/image#render

EDIT: Also be careful with the paths. If possible, use absolute paths OR preferably paths relative to your document root.

Sai Prasad

related questions