Where should someone put the static files such as

2020-02-10 04:20发布

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.

2条回答
▲ chillily
2楼-- · 2020-02-10 04:35

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>
查看更多
啃猪蹄的小仙女
3楼-- · 2020-02-10 04:38

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.

查看更多
登录 后发表回答