Where should someone put the static files such as CS, JS and images in the Codeigniter folder structure?
Basically in the html file, I would like to include static files as follows:
<link href='css/my.css' type="text/css"/>
<link href='js/my.js' type="text/jav开发者_Go百科ascript"/>
...
<img src="image/logo.jpg" />
In order to accomplish what I stated above, where should those static files need to go in the Codeigniter folder structure.
There's no real answer here, but what I use as best practice for CI projects is the following structure:
- assets
-- css
-- js
-- images
- system
-- <all CI folders here>
It all comes down to personal preference, I used to have a folder called 'assets' in the root directory alongside 'application' and 'system' but these days I prefer creating a folder called 'public' as it's more semantic.
It doesn't matter where you store them really, pick a name that means something to you.
精彩评论