misheck Posted November 15, 2009 Share Posted November 15, 2009 I am working on a website and it is going to have a lot of javascript and css files for all the components that I am putting on the site. Is there a way I can have just one php statement to load all the scripts on the page. I have been looking at http://wonko.com/post/a_faster_jsmin_library_for_php but there is no information on how to use it and do I have to echo the contents like they have done on my header file? If you know any alternatives I would appreciate. Quote Link to comment https://forums.phpfreaks.com/topic/181624-using-multiple-js-and-css-scripts/ Share on other sites More sharing options...
.josh Posted November 15, 2009 Share Posted November 15, 2009 well I suppose you could have them all in a directory and then grab all files from the directory and loop through them, echoing out script and/or link tags. Quote Link to comment https://forums.phpfreaks.com/topic/181624-using-multiple-js-and-css-scripts/#findComment-958028 Share on other sites More sharing options...
misheck Posted November 15, 2009 Author Share Posted November 15, 2009 I am a newbie but I know how to use the while loop but I am not sure about reading the files and echooing them onto by page but I guess I will need to google on redaing files in PHP. Thanks for the idea because I hadnt thought of that. Quote Link to comment https://forums.phpfreaks.com/topic/181624-using-multiple-js-and-css-scripts/#findComment-958123 Share on other sites More sharing options...
.josh Posted November 16, 2009 Share Posted November 16, 2009 glob Quote Link to comment https://forums.phpfreaks.com/topic/181624-using-multiple-js-and-css-scripts/#findComment-958182 Share on other sites More sharing options...
misheck Posted November 16, 2009 Author Share Posted November 16, 2009 Thanks I will give that a try. Quote Link to comment https://forums.phpfreaks.com/topic/181624-using-multiple-js-and-css-scripts/#findComment-958334 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.