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

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -