I need to append a variable to all Javascript files while they are included in a page automatically. The variable needs to be added before the page gets loaded.
Following is the example of what i need.
var scriptfile='http://www.whatever.com/myjs.js?rnd='+revision_number
I need to achieve this using Cake PHP.
I would extend the javascript helper, and write my own custom method to append the string, then call that new method in my layout.
Link, is the method you probably want to overwrite if you don’t create a custom one. http://api.cakephp.org/class/javascript-helper#method-JavascriptHelperlink