php - How to include JS/CSS files into templates of Slim Framework? -
i developing simple web app slim framework. got stuck simple problem. want include static files (css , javascript) template.
my project folder structure follows:
index.php //<=== routing happens. /flot layout.css jquery.js .... /templates first_template.php
my header of first_template.php contains:
<link href="../flot/layout.css" rel="stylesheet" type="text/css"> <script language="javascript" type="text/javascript" src="../flot/jquery.js"></script>
when call projects root url
http://localhost/xampp/projectx/
(i'm using xampp) template shows up, css , javascript stuff not working. google chrome console shows:
get http://localhost/xampp/projectx/flot/layout.css 404 (not found) http://localhost/xampp/projectx/flot/jquery.js 404 (not found)
any suggestions? spent almonst 1 hour in googling, overall documentation of slim framework still literally slim :)
i assume displaying template on project root (index.php), should remove ../
stylesheet , js relative paths:
<link href="flot/layout.css" rel="stylesheet" type="text/css"> <script language="javascript" type="text/javascript" src="flot/jquery.js"></script>
Comments
Post a Comment