I use
{% block ibox-title %}{% endblock %}
can not use -
Hi,
From the docs;
Block names should consist of alphanumeric characters, and underscores. Dashes are not permitted.
So your observation is correct and a known system limitation.
I just ran into the same issue. The error message should be more clear, e.g. "invalid block name ...".
Well, the point is that {% block ibox-title %} alone is valid. It is the same than {% block ibox -title %} i.e. creating a block named ibox with its content set by the expression -title (in which case the block tag does not expect a closing tag)
@stof while it makes sense, the behavior is somewhat unexpected.
To make things more clear, the shortcut notation could require a blank space between the block name and its content.
{% block ibox-title %} would be invalid
{% block ibox -title %} would still be valid
@davidgorges this would be very hard to implement, because spaces are optional and insignificant in Twig (there are cases where you usually use spaces to be sure that 2 things are considered as separate tokens by the lexer, but most of these cases could also use parenthesis to delimit one of the expression rather than separating them with spaces). Spaces are the mostly for readability.
Closing as there is unfortunately nothing we can do to fix this easily.
Most helpful comment
Hi,
From the docs;
So your observation is correct and a known system limitation.