Controlling oder of inclusion with CClientScript->registerScriptFile()

Hi All,

I have a number of scripts which depend on each other. Some of which are nessesary only when specific views are loaded. I would like to be able to load these scripts dynamically but I run into problems with dependencies. Is there a way that I can control the order in which assests registered with CClientScript->registerScriptFile() are loaded so I can ensure that the dependencies of my javascript files are loaded first? :blink:


Chris M.

Well, they’re output in the order to include them, so you could just make sure that the lines are in your views in that order. Alternatively you could take a look at custom JS packages that support dependencies.