![]() |
base_url() problems // designers are about to kill me :( - 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: base_url() problems // designers are about to kill me :( (/showthread.php?tid=3475) |
base_url() problems // designers are about to kill me :( - El Forum - 10-04-2007 [eluser]noland[/eluser] Hello all; There's one question I need to sort out, so any help will be well received. In this case, I'm having troubles with the design department due to base_url(). I suppose I'm doing something bad, but I have to use everytime base_url() in order to use all the resources related to my views, for example: Code: <img src="<?=base_url()?>img/iconos/insertar_titulo.gif" name="Image8" border="0" align="absmiddle"> or Code: script src="<?=base_url()?>js/browserDetection.js" language="javascript"> because if I don't specify this base_url() the images simply doesn't load, the scripts don't work, and so on. Same with css, etc, which cause to the designers (and for me) a total destruction of the page layout. Is there any workaround which permits to my dreamweaver reach correctly the route to the resources? Thanks so much! base_url() problems // designers are about to kill me :( - El Forum - 10-04-2007 [eluser]CI Auke[/eluser] If you ask me you don't need to specify, have to use, the base_url() base_url() problems // designers are about to kill me :( - El Forum - 10-04-2007 [eluser]Sarfaraz Momin[/eluser] Hi, I have not used base_url() for any entities on the page. They can be directly accessed using the / and having them in root folder. I don't see a reason to specify base_url(). base_url() problems // designers are about to kill me :( - El Forum - 10-04-2007 [eluser]Michael Wales[/eluser] I personally create the following 3 folders at the root level: css, js, and images. I then reference those as such (note the starting slash in the URI): Code: <img src="/images/myimage.jpg" /> A lot of other people would rather create an assets folder at the root level, and then place the 3 folders named above within it. Code: <img src="/assets/images/myimage.jpg" /> Either way - referencing all of your assets, via a relative link from the root level, is the best option with CI. base_url() problems // designers are about to kill me :( - El Forum - 10-04-2007 [eluser]lkagan[/eluser] As long as you don't have to move the entire application to a subdirectory, you'll be fine with absolute references. I recently had to move my app to a subdirectory and was very glad that I used base_url(). I only had to change one line of code for all assets to correctly be references. base_url() problems // designers are about to kill me :( - El Forum - 10-15-2007 [eluser]noland[/eluser] first of all, thank you very much for your answers, and sorry for the delay greeting you them. The problem was that I was working in a subdirectoy, so that's why my IDE couldn't get in touch with those resources. I could 'see' the images, etc, simply switching the combo box "relative to" when linking to the resources between "document" and "site root". Now, it automatically adds as a prefix the subfolder inside the webroot, and it works! Thanks very much once again for your advices ![]() |