Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twig: comments in {% javascripts %}

I have a situation like this in my twig file:

{% javascripts
    'js/functions.js'
    'js/plugins.js'
    'js/editor.js'
    'js/calendar.js'
%} [...]

And I would love to comment some scripts out using

{% javascripts
    {# 'js/functions.js' #}
    'js/plugins.js'
    'js/editor.js'
    'js/calendar.js'
%} [...]

But this isnt allowed, I get an Unexpected character "#" error.

Is there a common practice how to handle this?

like image 370
a1337q Avatar asked Nov 03 '22 10:11

a1337q


1 Answers

That is unsupported twig syntax, obviously. So it's up to you how to hide it. I would do something like this:

{#    'js/functions.js'#}
{% javascripts
    'js/plugins.js'
    'js/editor.js'
    'js/calendar.js'
%} [...]
like image 78
lifo Avatar answered Nov 15 '22 01:11

lifo