Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can show image at view from webroot

I am trying to show image at view from webroot in cakephp. But I didn't get any image. Please help me;

Is this code correct

$this->Html->image('WWW_ROOT . img/upload/aswq.png', array('width'=>'200px'));
like image 537
Yogesh Karodiya Avatar asked Oct 25 '25 15:10

Yogesh Karodiya


1 Answers

you can use in this way to show image from webroot folder. just notice that img folder already included path in html helper

 echo $this->Html->image('upload/aswq.png', array('width' => '200px','alt'=>'aswq'));

Will output:

<img src="/img/upload/aswq.png" alt="aswq" />

let me know if i can help you more.

like image 121
liyakat Avatar answered Oct 27 '25 05:10

liyakat