Answer the question
In order to leave comments, you need to log in
How to use Twig block content twice in PHP?
Is it possible to use the contents of a Twig block twice in PHP?
If you do this:
<title>{% block title %}{% endblock %}</title>
<h1>{% block title %}{% endblock %}</h1>
Fatal error: Uncaught exception 'Twig_Error_Syntax' with message 'The block 'title' has already been defined line 7 in "base.layout" at line 58'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question