Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Assetics + Twig #6

lyrixx opened this Issue Sep 17, 2011 · 15 comments


None yet
7 participants

sveneisenschmidt commented Sep 18, 2011

What does exactly not work?
Any errors?


lyrixx commented Sep 18, 2011

I do not want to load all my asset from the config.
So when I use, in a twig template, {% javascripts ... %} It does not add an asset collection to the asset manager.

Please see here : lyrixx/Silex-Kitchen-Edition@32b4fbc#L8L49

@lyrixx lyrixx closed this Sep 18, 2011

@lyrixx lyrixx reopened this Sep 18, 2011


sveneisenschmidt commented Sep 20, 2011

I'll have a look. Do you have jabber/gtalk?


lyrixx commented Sep 20, 2011

Yes, i sent you a message.


any updates about this issue? It will be great to use assetic in twig templates for silex

cj commented Oct 28, 2011

Any updates on this?


sveneisenschmidt commented Nov 1, 2011

unfortunately not.

i've been working with the Fate/Assetic extension too.. referencing the Kitchen-Edition setup.. that code doesn't seem to be working quite right..The asset files get created and saved.. but once you make modifications the asset arrays.. it seems to get buggy.


sveneisenschmidt commented Nov 11, 2011

Maybe I'll have to rewrite it.

I found the big reason I was having problems was because I wasn't paying attention to the assetic ['debug'] behavior. It was caching the the scripts.js so of course it wasn't updating like I wanted.. However, I'm still finding that when I add additional j-scripts like jquery-extensions, the created script doesn't behave like I expect it too and I have a to keep it separate. It seems like even in the example on Kitchen-Edition -- jquery is left out.. not sure why that was done.


lyrixx commented Nov 11, 2011

Jquery is left out because many websites do the same thing. So it's pretty sure that jquery will already be in client browser cache. ;)


sveneisenschmidt commented Jan 12, 2012

So, the problem still exist?

I've looked through Symfony and borrowed some bits to get Assetic and Twig to play nice together in Silex apps. Let me know what you think (the code probably needs to be cleaned a bit).


I've updated my code a bit to fix a few debug issues and pull in a bit more of the caching code provided in the AsseticBundle.


mheap commented Nov 17, 2012

As far as I know, Silex + Twig + Assetic are playing together nicely now (if you use dumper->addAssets()).

@mheap mheap closed this Nov 17, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment