我要谈以下几点:
我所有页都有一个基本模板,即“_page_base.twig
。 它包括头盔和脚.。
然后,我有网页不同领域的模板:“topic.twig
”、“section.twig
”和“article.twig
-其中每一部分均扩展了“_page_base.twig
,迄今为止运作良好。
Now I want to write my articles. I would love to save them as .twig file as well, since I can edit the complete markup in my editor and just upload it.
Since I can t say that my article files just extend "article.twig
" (multiple inheritance is not possible) I could tell the "article.twig
" that it should use blocks from my different article-content twigfiles.
The problem is: "use" statements have to be hardcoded!
我目前的解决办法是,将{%的“[PLACEHOLDER]”改为“
article.twig
,然后将模板装入一个插图,将持单人替换为正确的条款内容。 两次,然后将整件材料转至模板发动机。 什么东西。
你们是否为更好的解决办法提出任何想法?