codeigniter包括css或js文件

mio*_*amo 2 codeigniter

如果它在应用程序文件夹中,为什么我不能在视图中包含任何内容?

我在主目录中包含时很好:

这有效:

<link rel="stylesheet" type="text/css" href="{ci_base_url}css/site.css" /> 
Run Code Online (Sandbox Code Playgroud)

但这不起作用:

<link rel="stylesheet" type="text/css" href="{ci_base_url}application/css/site.css" />
Run Code Online (Sandbox Code Playgroud)

为什么??

提前致谢

Ric*_*lli 6

只有您称为"主目录"的内容才能通过http请求直接访问.这是出于安全原因.通常那个目录被命名为"公共"