0
我的樹枝模板具有for循環,並且我正在嘗試向其添加可變長度。我該怎麼做呢?具有變量的樹枝模板
('var')需要是變量>內容。 + var + .related.buttons
{% include '@PleinCatalog/Theme/includes/themeCatergory.html.twig' with {'var':'something'} %}
{% for button in content.('var').related.buttons %}
<a href="{{ button.url }}" class="btn btn-block btn-success">{{ button.title }}</a>
{% endfor %}
我認爲它應該像這樣工作'{%,爲內容按鈕[VAR] .related.buttons%}' –
工程就像一個魅力..謝謝! – Christien