• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
codeigniter doesn't allow you to use relative paths for css and javascript loading?

Hey all,

I tried this for hours and I am 100 percent that it was pointing at the right directory:

<link rel="stylesheet" type="text/css" href="../public/stylesheets/application.css" />
//this is in template.php which is in views which is at the same level as public, so I go up a directory, go to public, find stylesheets, and then load application.css. This should work but doesn't.

Then finally I tried this and it worked:
<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:

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.

In your head tags!
<base href="<?php echo base_url();?>">


thanks for response

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.