0
如何在循环中将一个数组中的值插入到另一个数组中? 例如将另一个数组中的值替换为数组twig
{% for day_item in template_string %}
<div id="{{lessons.{{day_item.template_string}}.id}}" class="col-lg-2 no-padding col-md-2 col-sm-12 col-xs-12"></div>
{% endfor %}
谷歌搜索 “PHP树枝动态变量”(https://www.google.co.uk/search?q=php+twig+dynamic+variable),最答案似乎围绕使用属性函数(https://twig.sensiolabs.org/doc/2.x/functions/attribute.html)。很确定这是你需要的,这个问题只是这些问题的另一个变种?这对你有用吗? –