gpt4 book ai didi

include - 在包含路径中使用 Twig 变量

转载 作者:行者123 更新时间:2023-12-04 22:30:31 25 4
gpt4 key购买 nike

我想在包含行中使用 Twig 变量,但它不起作用:{% include 'folder/{{ component }}.twig' %}
我收到错误:Unable to find template "folder/{{ component }}.twig"
谁能帮我吗?

谢谢!

最佳答案

我刚刚在这里找到了答案:
https://groups.google.com/forum/#!topic/twig-users/zfnxC16gHx0

正确的语法是:{% include 'folder/' ~ component ~ '.twig' %}

关于include - 在包含路径中使用 Twig 变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28428027/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com