How To Insert Image In View Pages

I wanna ask how to insert image into a new view page. For example, I’d created a file named me.php and I put it into the general folder that I created earlier in Views. So when I open it through browser which is me.php, the image couldn’t load and can’t ever see the image. Can someone help me, I already use many codes to make it works,…

in ur view use CHtml::image(‘path.to.image.jpg’,‘alt text’); for more info refer. codingtip.blogspot.com/2013/09/yii-framework-chtmlimage-example.html?m=1y

use





echo CHtml::image(Yii::app()->request->baseUrl.'/files/image.jpg','this is an alternative text',array('width'=>100,'height'=>100));


//produces


<img src="example.com/files/image.jpg" alt="this is an alternative text" width="100" height="100" />



Please try this





echo CHtml::image(Yii::app()->request->baseUrl.'/images/imagename.png', "alt tag of image");