I am working on a CakePHP project that sometimes needs to load the Javascript and CSS for the jQuery Datepicker.
I only want it to load when needed, and I want one central loading point because there are several files involved, and if something changes, I, of course, don't want to go back and change it in all the places the datepicker files were loaded.
Right now, I've created an element called 'load_datepicker'. The only code in this file is the CakePHP calls to load the necessary files. I could not find any other solution.
This -seems- to be a good solution. I can load an element into any view or other elements.
Is this a reasonable way to approach this need or is there some specific CakePHP way to do this?
lee