我有一个存储在数据库中的图像路径字符串
它就像:img / uploads / imagename.jpg
我有一个控制器:
$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
答案 0 :(得分:0)
答案 1 :(得分:0)
您无需使用回声本身。 render()本身将输出回显给浏览器。也许,你需要使用render(true),根据文档。 http://docs.kohanaphp.com/libraries/image#render
编辑:也要小心路径。如果可能,请使用绝对路径或优选路径相对于文档根目录。