![]() |
codeigniter image path. - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: codeigniter image path. (/showthread.php?tid=43596) |
codeigniter image path. - El Forum - 07-17-2011 [eluser]FlyingCat[/eluser] I am a codeignite newbie and tried to add an image in my file under view folder. I add Code: <img src="../images/myImage.jpg"></img> however, if I change my path to Code: <img src="../../user_guide/images/myImage.jpg"></img> My file system is as follow: Code: application- Can anyone help me about this? Thanks a lot! codeigniter image path. - El Forum - 07-17-2011 [eluser]Eric Barnes[/eluser] You should really use the base_url or img helper to create absolute paths - http://ellislab.com/codeigniter/user-guide/helpers/html_helper.html#img Code: <img src="<?php echo base_url(); ?>images/myImage.jpg" /> By the way the image html tag doesn't have a closing tag. codeigniter image path. - El Forum - 07-17-2011 [eluser]FlyingCat[/eluser] Thanks a lot Eric!! Your link does help me a lot! |