Answer the question
In order to leave comments, you need to log in
Silex + Twig. Why is it impossible to include a block in a template?
Hi
For the first time I tried to take out part of the layout in a separate file and include it in the template.
I develop on silex using twig.
Everything seems simple in the twig documentation:
{% include 'header.html' %}
Body
{% include 'footer.html' %}
Answer the question
In order to leave comments, you need to log in
show all the code that works with twig.
apparently, you are working with twig something like this
$loader = new Twig_Loader_String();
$twig = new Twig_Environment($loader);
if the templates are in files, then you need
$loader = new Twig_Loader_Filesystem('/path/to/templates');
$twig = new Twig_Environment($loader);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question