Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是Timber / Twig的新手,但到目前为止我很喜欢它!
我想要一个文件夹,其中包含 Timber/Twig 所称的部分/组件或“块”,所以我可以说一个“video.twig”组件,它可以在整个页面中重复使用。
1) 如何在文件夹中“注册”组件/块?
2)我怎样才能给组件/块“喂”数据?我想做这样的事情:
{% block component DATA %}
中的语法include如下所示:
include
{% include "comment.twig" with {comment:cmt} %}
它也可能适用于该块。试一试。