Hi Dan,

I set a different directory for compressed and uncompressed JS. In Dev this
could point to a loader.js which loads all your modules and in prod just
loads the one big js file.

The directory variable could be set in the settings.yml 

 

Regards

Fabian

 

From: [email protected] [mailto:[EMAIL PROTECTED]
On Behalf Of Daniel Stevens
Sent: Samstag, 11. Oktober 2008 21:42
To: [email protected]
Subject: [symfony-users] Setting Javascripts by Environment

 

I've been using the symfony framework for my ajax applications for over a
year now and it's simply the most intuitive platform for an ajax/php
developer - many thanks to the team for that.

One limitation I *think* I've run into is the ability to set different
javascript files depending on the environment. In the dev environment I need
all my individual JS modules to be loaded and in the prod and test
environments I need the packed version of my JS (which I keep in the
js/build directory). Right now I just have to comment/uncomment the
javascript setting in the view.yml files depending on the environment I'm
choosing to run. I couldn't see how the view.yml files are capable of
discerning between environments. I also tried to use the action class to
remove the production JS and replace with the development JS when in the dev
environment but the getJavascript function returns an empty array in the
action class, and thus I cannot use removeJavascript to clear out the
current build scripts. Also '-*' doesn't work in the action class to remove
scripts.

Does anyone know of a way to automatically include javascripts based on the
environment? If there's not a snappy way it would probably be a good feature
to have for us heavy Ajax users - although I'm sure you guys are plenty busy
with many other TODOs. Maybe I'll create a plugin if no one has any advice
on how to do this and if there's other people interested in such a plugin.

Please let me know and many thanks!
Dan


 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to