Creating Processed JS Files
To create a processed JS file you'll need to add arrays to your configuration variable. In the below example, we're going to create http://www.website.com/js/site.js by including jquery.js and main.js.
$bigtree["config"]["js"]["files"]["site"] = array( "jquery.js", "main.js" );
For this example, site.js will first include jquery.js and then main.js. If any of the files changes, the cache will be destroyed and users will be served a new copy.
To turn on JS minifying, set
$bigtree["config"]["js"]["minify"] in your
/templates/config.php file to
true. This setting defaults to false.
$.ajax("$www_root" + "ajax/$folder/");
/templates/config.php with the following code (the array should exist in the default config, just add the keys you need).
$bigtree["config"]["js"]["vars"] = array( "folder" => "goose" );
There are two variables that are ALWAYS present and converted: www_root/ and $www_root. You do not have to set these in your configuration file. www_root/ is a convenient way to address your root URL since it always has a / at the end. Take the code from above, modified to use www_root/ instead of $www_root: