![]() |
codeigniter doesn't allow you to use relative paths for css and javascript loading? - 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 doesn't allow you to use relative paths for css and javascript loading? (/showthread.php?tid=40742) |
codeigniter doesn't allow you to use relative paths for css and javascript loading? - El Forum - 04-17-2011 [eluser]johnmerlino[/eluser] Hey all, I tried this for hours and I am 100 percent that it was pointing at the right directory: Code: <link rel="stylesheet" type="text/css" href="../public/stylesheets/application.css" /> Then finally I tried this and it worked: Code: <link rel="stylesheet" href="<?php echo base_url();?>system/application/public/stylesheets/application.css" type="text/css" media="screen"/> The issue maybe that I am not even clear as to what file the server has been requested. Basically, when the user goes to the home page, for example, it triggers the show method of the categories class (which is itself a 'controller' in mvc). That show method populates show.php in categories directroy with data depending on what posts have been associated with the category 'home'. Then that show.php results gets put into template.php, which contains the header info and this gets called: Code: return $this->CI->load->view($template, $this->template_data, $return); $template refers to template.php and template data is the data from show.php. This load->view is called within a library called Template.php So I am not even clear myself what actual file the server is requesting since a lot of files are being requested. Thanks for response. codeigniter doesn't allow you to use relative paths for css and javascript loading? - El Forum - 04-17-2011 [eluser]InsiteFX[/eluser] In your head tags! Code: <base href="<?php echo base_url();?>"> InsiteFX codeigniter doesn't allow you to use relative paths for css and javascript loading? - El Forum - 04-23-2011 [eluser]johnmerlino[/eluser] thanks for response |