I
I
Ivan2014-08-21 14:33:33
symfony
Ivan, 2014-08-21 14:33:33

What does a dash do in a block declaration in Twig?

In symfony templates (for example, in form_div_layout.html.twig ) I came across this code:

{% block example -%}
...
{%- endblock example %}

What are these dashes for? In my opinion, without them, twig works exactly the same.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2014-08-21
@0neS

twig.sensiolabs.org/doc/templates.html#whitespace-...
These dashes can be put in general for all blocks, for if, for, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question