![]() |
Base URL in Views - 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 in Views (/showthread.php?tid=24490) |
Base URL in Views - El Forum - 11-11-2009 [eluser]Assim[/eluser] Let's say I have this view file: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" I want the to put the site's full address behind images/favicon.ico and behind csss/style.css because they won't work in all the pages because of CodeIgniter's URLs. I tried putting: <?php echo base_url(); ?> But it didn't work, what am I doing wrong. This is the code after editing (added <?php echo base_url(); ?> ![]() Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" Base URL in Views - El Forum - 11-11-2009 [eluser]Buso[/eluser] what didn't work? is it throwing any errors? is it not printing anything for base_url() ? have you set up your base_url in your config.php file? have you loaded the corresponding helper? Base URL in Views - El Forum - 11-11-2009 [eluser]Assim[/eluser] Man, thanks. I've been trying to figure this out for days, it was all because I forgot to load the helper. Thanks. ![]() |