Skip to content

Instantly share code, notes, and snippets.

@robflaherty
Created August 18, 2011 01:09
Show Gist options
  • Select an option

  • Save robflaherty/1153058 to your computer and use it in GitHub Desktop.

Select an option

Save robflaherty/1153058 to your computer and use it in GitHub Desktop.
concatenate js with php example
<?php
header('Content-type: application/javascript');
$files = array(
//Plugins
dirname(__FILE__) . '/plugins/jquery.hoverIntent.min.js',
dirname(__FILE__) . '/plugins/jquery.placeholder.min.js',
dirname(__FILE__) . '/plugins/jquery.form.min.js',
dirname(__FILE__) . '/plugins/jquery.tabs.min.js',
dirname(__FILE__) . '/plugins/jquery.tweet.min.js',
dirname(__FILE__) . '/plugins/jquery.validate.min.js',
dirname(__FILE__) . '/plugins/jquery.superfish.min.js',
//Core scripts
dirname(__FILE__) . '/core.js',
//Other scripts
dirname(__FILE__) . '/main.js'
);
foreach ($files as $file) {
require($file);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment