Codeigniter包含CSS或JS文件 [英] codeigniter include css or js file

查看:159
本文介绍了Codeigniter包含CSS或JS文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么它不能包含在应用程序文件夹中?

Why I can't include anything from views if it is inside application folder?

当我将其包含在主目录中时,这没问题:

It is fine when I include in main dir:

这有效:

<link rel="stylesheet" type="text/css" href="{ci_base_url}css/site.css" /> 

但这不起作用:

<link rel="stylesheet" type="text/css" href="{ci_base_url}application/css/site.css" />

为什么??

请先谢谢

推荐答案

仅可通过http请求直接访问称为主目录的内容。出于安全原因。通常将该目录命名为公共

Only the content in what you called the "main dir" is directly accessible via http requests. That's for security reasons. Often that dir is named "public"

这篇关于Codeigniter包含CSS或JS文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆