我使用下面的树枝,以产生每行symfony的树枝批次参考阵列错误
{% for row in products|batch(3, 'No item') %}
<div class="row">
{% for product in row %}
<div class="col-lg-{{}}"></div>
{% endfor %}
</div>
{% endfor %}
项行循环的内部,其中我关于产品产量细节我有referencies到我通过产品阵列等
功能<a href="{{ productUrl(product) }}"></a>
,但如果我使用批量我收到以下错误该代码不起作用
getProductUrl() must be of the type array, string given
你在哪里定义了函数'productUrl()'? – DOZ