Consider the following template:
<html>
<head>
<title>{% block title %}{% endblock %}</title>
<body>
<h1>{% block title %}{% endblock %}</h1>
Clearly the goal here is to have the title block substituted identically in both places. However, this causes a compile error:
[Twig_Error_Syntax]: The block 'title' has already been defined line 3.
I propose identical blocks with the same name should be allowed to promote reuse.
Why not replacing the second one with {{聽block('title') }}?
Oh, I see, I was not aware of a block function. It might be useful if that was mentioned in either the block tag or extends tag documentation, for those unaware. Thanks for the tip!
@Bilge Can you submit a PR to improve the docs?
Most helpful comment
Why not replacing the second one with
{{聽block('title') }}?