B
B
BonBon Slick2018-07-15 01:59:55
Twig
BonBon Slick, 2018-07-15 01:59:55

Is there any way to improve the readability of a Twig macro?

https://twig.symfony.com/doc/2.x/tags/macro.html
There is one thing, but in the case when we do an include, we can go to the template thanks to the Symfony package in phPStorm from the file in which we do the include.
What can not be said about the macro, besides, the data transfer format, it is not clear what we are passing to the macro, include wins here too.
Is there a way to add macro hints?

{% block search %}
    {{ macroName.macromethod(
      items
    ) }}
{% endblock %}


    {% include 'template.html.twig' with {
        'items': items,
    } %}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question