Insert Images |
[eluser]Unknown[/eluser]
Hello, I am new to CodeIgniter. I read the user guide but I think I missed something. How do you insert an image onto a page? I am not sure if I have to create a folder in the view folder or outside. I created a folder and put all the images in it but nothing show up on the page when up loading the images. Can someone help the baby user. Thanks
[eluser]CI TaMeR[/eluser]
I have created a helper for that called 'img_helper.php' it has with two functions 'anchor_icon()' and anchor_image() maybe that will help Code: function anchor_icon($uri, $image, $title = FALSE)
[eluser]gunter[/eluser]
outside is the right answer! so you can load them from http://www.something.com/img/blabla.jpg....
[eluser]Phil Sturgeon[/eluser]
A few methods, gunter is onto one of them. Make yourself a media or assets folder. For example call images like: A) Quote:<a href="/media/images/something.gif"> or B) Quote:<a href="<?=site_url();?>media/images/something.gif"> Option A means your script HAS to be in the root, or option B means you have to have the URL helper loaded at all times. Either is just as good, i personally preffer option A.
[eluser]Michael Wales[/eluser]
I go with option A as well, although a slight variation (same end result). I create 3 folders at the root level: css, js, and images. |
Welcome Guest, Not a member yet? Register Sign In |