symfony - Twig: comments in {% javascripts %} - Stack Overflow

I have a situation like this in my twig file:{% javascripts'jsfunctions.js''jsplugins.

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 ment 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 mon practice how to handle this?

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 ment 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 mon practice how to handle this?

Share Improve this question edited Nov 25, 2012 at 16:50 a1337q asked Nov 25, 2012 at 16:38 a1337qa1337q 7803 gold badges10 silver badges20 bronze badges 4
  • 2 I believe you'll have to remove js/functions.js line. You can move it to separate ment, just to remember that it was there. – Crozin Commented Nov 25, 2012 at 16:54
  • @Crozin, okay. This is the way I'm doing it now, but it's not very handy. – a1337q Commented Nov 25, 2012 at 17:03
  • this is what version control was built for, you shouldn't have to leave mented code in your files long term – JamesHalsall Commented Nov 26, 2012 at 8:37
  • 1 @Jaitsu yes and no. Since the order of the script matters, I need to have it somewhere. But generally you're correct of course, dead code is ugly as hell. Best variant for my problem is probably to leave a plete block mented out on purpose somewhere in a template. – a1337q Commented Nov 26, 2012 at 13:06
Add a ment  | 

1 Answer 1

Reset to default 4

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'
%} [...]

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745585482a4634511.html

相关推荐

  • symfony - Twig: comments in {% javascripts %} - Stack Overflow

    I have a situation like this in my twig file:{% javascripts'jsfunctions.js''jsplugins.

    8小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信