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/javascript"/>
...
<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.
/public/img/
Adding JavaScript and CSS (Cascading Style Sheet) file in CodeIgniter is very simple. You have to create JS and CSS folder in root directory and copy all the . js files in JS folder and . css files in CSS folder as shown in the figure.
Core − This folder will contain base class of your application. Helpers − In this folder, you can put helper class of your application. Hooks − The files in this folder provide a means to tap into and modify the inner workings of the framework without hacking the core files.
Database - It contains database drivers and other utilities. Fonts - It contains font related information. Helpers - It contains default helpers such as URL, date and cookie. Language - CodeIgniter supports multilingual web applications.
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With