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

Closed
lyrixx opened this Issue Sep 17, 2011 · 15 comments

Comments

Projects
None yet
7 participants
Collaborator

sveneisenschmidt commented Sep 18, 2011

What does exactly not work?
Any errors?

Contributor

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

Collaborator

sveneisenschmidt commented Sep 20, 2011

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

Contributor

lyrixx commented Sep 20, 2011

Yes, i sent you a message.

Thx

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?

Collaborator

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.

Collaborator

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.

Contributor

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. ;)

Collaborator

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).

https://github.com/digitaltoad/Silex-Extensions/commit/2dba9cb7c4777415b696e57e47f021103a08f4d0

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.

Owner

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