I am new to codeigniter. I made a simple controller to load the three views: header, body and footer. My header contains links to several javascripts and CSS which have a relative paths. I kept all the css and js relative to file in views folder.
The problem is that the controller loads everything properly but images, js and css are not getting loaded.
This is the hierarchy of my view:
CSS(sub directory in views)
JS (sub directory in views)
header (header view file)
body (body view file)
footer (footer view file)
ny idea?
Best Answer
It is not a good idea to put everything in your view file, as those folders are supposed to clean things up, putting them in view makes them messy again.
Assume this is your directories:
Localhost
To include any of javascripts, the path would be:
and obviously CSS would be
In order to make sure your implementation work everywhere,
would be the safest way