我正在使用Slim框架开发一个简单的Web应用程序。我遇到了一个可能很简单的问题。我想将静态文件(CSS和Javascript)包含在我的模板中。
我的项目文件夹结构如下:
index.php //<=== where all the routing happens.
/flot
layout.css
jquery.js
....
/templates
first_template.php
我的first_template.php的标题包含:
<link href="../flot/layout.css" rel="stylesheet" type="text/css">
<script language="javascript" type="text/javascript" src="../flot/jquery.js"></script>
当我调用项目的根URL时
http://localhost/xampp/ProjectX/
(我正在使用XAMPP)模板显示出来了,但CSS和JavaScript等内容没有生效。 Google Chrome控制台显示:
GET http://localhost/xampp/ProjectX/flot/layout.css 404 (Not Found)
GET http://localhost/xampp/ProjectX/flot/jquery.js 404 (Not Found)
有什么建议吗?我花了将近一个小时在谷歌上搜寻,但是Slim框架的整体文档还是相当简单。