Hi Michael! Something like this is not possible currently in Assetic, and actually I think can't be, since the JavaScript contains dynamic code, but Assetic compiles and dumps the files just one time and so can't be dynamic.
Typically, if you've gotta mix JavaScript and dynamic code, a better approach is to setup some JavaScript variables in your template, and then make use of them from an external JavaScript file. For example,if you need some dynamically generated URL, I'll use https://github.com/FriendsOfSymfony/FOSJsRoutingBundle so that I can write JS in an external file, but have access to that info. Cheers! Ryan Weaver US Office Head & Trainer - KnpLabs - Nashville, TN http://www.knplabs.com <http://www.knplabs.com/en> http://www.thatsquality.com Twitter: @weaverryan On Thu, Dec 29, 2011 at 9:37 AM, Michael <[email protected]> wrote: > I have some javascript code in side one of my twig pages.. the script > also contain twig code. Is there a way to minify that using twig tags? > if not, how can I create a js file with twig so that i can use assetic > to minify it? > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > You received this message because you are subscribed to the Google > Groups "symfony developers" 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-devs?hl=en > -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony developers" 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-devs?hl=en
