smoya/AssetManagementBundle

Custom Tags

Closed this issue · 2 comments

I ran across your bundle while looking into ways that would allow included templates to place their javascript at the bottom of the base template, and overall it works exactly like how I want but had one question.

Do you know what it would take to add the ability for custom tags to work how your functions currently work? For example

Rather than
{{ add_assets('alert("Widget Loaded");', 'inline_js') }}

Something like
{% javascript %}
alert("Widget Loaded");
{% endjavascript %}

Where the body of the javascript node would still be placed where calling your {{ render_assets() }}

This would allow for much cleaner representation of inline javascript, even compared to using {% set inline_javascript %} method.

Thanks

I do not like the idea to interfere in the behavior of the twig labels. However, I will study the implications that it would have what you comment.

Thank you very much @taylorludwig

wont apply.