TWIG将变量传递给宏

时间:2018-06-09 14:21:41

标签: twig symfony-3.4

何我可以将值发送到树枝宏 - 在我的情况下盖子“88”? 我的宏:

{% import _self as formMacros %}

        {% macro printfilesRow(filesForm, lid) %}

            {{dump( lid) }} // not working ;-(

{% endmacro %}

在我的表单中使用宏:

{% set lid = 88 %}

                {% for filesForm in content.picture %}
                    {{ formMacros.printfilesRow(filesForm, lid) }}
                {% endfor %}

0 个答案:

没有答案
相关问题