wrong image and css files paths in view files |
[eluser]cb951303[/eluser]
[quote author="Sumon" date="1220803807"]I am not sure my approach is standard or not. But i use it without getting any trouble. Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" Only add base url before any css or image location. this produce absolute path and doesn't create any problem for me.[/quote] that's the one I was looking for ![]()
[eluser]esra[/eluser]
The complex one is based on the same approach. The complex one appends fragments of various urls to the base_url config parameter.
[eluser]phantom-a[/eluser]
I had this problem too. ![]() It tries loading images and css from http://example.com/index.php/controller/images/ but does not exist, Then I use baseurl as others said here.
[eluser]cb951303[/eluser]
uhmm... sory for being noob but there is no function called "base_url()"? is it a CI function or core PHP?
[eluser]Pascal Kriete[/eluser]
It's a function of the URL helper (a good one to autoload).
[eluser]cb951303[/eluser]
[quote author="inparo" date="1220813274"]It's a function of the URL helper (a good one to autoload).[/quote]thanks everything works perfectly now ![]()
[eluser]Tanque[/eluser]
as Sumon said... just need base_url() before the url to get your files... ci it's strange about this, but this way should work perfectly... i had the same problem last week... don't get scare... it's just that, base_url()...
[eluser]jackbenning[/eluser]
<?php echo base_url();?>images/myimage.png <?php echo base_url();?>css/mycss.css <?php echo base_url();?>js/myjs.js FTW
[eluser]Dave Rau[/eluser]
How do you use base_url() in a php header file being included that's outside of the CI tree?
[eluser]Colin Williams[/eluser]
CI trees are magnificent. I grew one outside my office. Incredible how complex this stuff is made to be... ![]() |
Welcome Guest, Not a member yet? Register Sign In |