Is it possible to transfer a template to a variable? The question is, I have the index.twig file in it, I need to substitute a piece of html with forms depending on the logic. these forms are stored in a separate file form.twig (as used in other places too) at the moment I use the following way {% if check %} {% include 'form.twig' %} {% endif %}

How can this form.twig file form.twig stored in a form.twig and substituted in the right places without include but simply {{ form }} ?

  • Explicit is better than implicit. You can try to do it through a macro, but I don’t see any point in it - ArchDemon February
  • what's the point? what include is not suitable? - SnakeMS

0