CodeIgniter Forums
DIsplay Images from folder into website using the MVC framework - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Model-View-Controller (https://forum.codeigniter.com/forumdisplay.php?fid=10)
+--- Thread: DIsplay Images from folder into website using the MVC framework (/showthread.php?tid=66192)



DIsplay Images from folder into website using the MVC framework - greg_c - 09-18-2016

I wish to display an image in a website using PHP - MVC framework. I've got the following in views:
Code:
echo("<img src=\images/test.jpg" />");
but all I am is getting a square coming up. Can someone give me a nudge in the right direction?  Do I need to have some code in the controller, and if so what is required?


Thanks


RE: DIsplay Images from folder into website using the MVC framework - InsiteFX - 09-18-2016

PHP Code:
<img src="<?php echo base_url('images/test.jpg'); ?>" /> 



RE: DIsplay Images from folder into website using the MVC framework - Wouter60 - 09-18-2016

Also working:
PHP Code:
<img src="<?php echo base_url() . 'images/test.jpg'; ?>" /> 



RE: DIsplay Images from folder into website using the MVC framework - greg_c - 09-19-2016

Thank you