Php 细枝模板层次结构
我是否可以以某种层次结构的方式拥有模板文件夹,如以下类似方式:Php 细枝模板层次结构,php,twig,Php,Twig,我是否可以以某种层次结构的方式拥有模板文件夹,如以下类似方式: View: Hey, can I render this template? Twig: Sure bro, let me check in abc/directory... Twig: Here you go! View: Thanks bro! 模拟2: View: Hey, can I render this template? Twig: Sure let me check in abc/directory... Twig
View: Hey, can I render this template?
Twig: Sure bro, let me check in abc/directory...
Twig: Here you go!
View: Thanks bro!
模拟2:
View: Hey, can I render this template?
Twig: Sure let me check in abc/directory...
Twig: Blasted balls! It doesn't exists, let me check in the bbc/directory instead.
Twig: Here you go!
View: Thanks bro!
最终模拟:
View: Hey, can I have this template?
Twig: Sure let me check in abc/directory...
Twig: Blasted balls! It doesn't exists, let me check in the bbc/directory instead.
Twig: Exception!
View: Wait what?
正如您所见,我希望在许多文件夹中都有模板,我只是希望以某种方式找到它们,我在Twig文档中找不到任何关于拥有多个文件夹的内容,尤其是没有以某种层次结构的方式
哦,顺便说一下,目录结构如下:
abc/
bbc/
templates/
ddc/
templates/
ccc/
templates/
adc
templates/
bbc、ddc和ccc模板是“模块”
有什么解决方案吗?请包括“向我们展示您的代码”,您的问题无法以当前的形式得到回答。如果您使用Zend framework 2和ZFcTwig软件包,您可以使用Zend的模板堆栈来完成这类工作。只要有一根细枝,我想你就必须找到/写一个扩展。