Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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/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.

like image 695
Cory Avatar asked Feb 21 '11 23:02

Cory


People also ask

Where should I store images in CodeIgniter?

/public/img/

Where should I store CSS files in CodeIgniter?

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.

What is the use of core folder in CodeIgniter?

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.

What is the file structure in CI?

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.


1 Answers

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>
like image 125
thomaux Avatar answered Oct 19 '22 05:10

thomaux