1
我想在zend框架中實現模板系統。使用Zend_Layout管理多個佈局?
我基本上用來把所有partials文件和模板的變化放在一個文件中,但隨着模板的增加,這是非常難以管理的。
例如
/application/layout/script/template1partial-banner.phtml
/application/layout/script/template1partial-footer.phtml
/application/layout/script/template1variation1.phtml
/application/layout/script/template1variation2.phtml
/application/layout/script/template2variation1.phtml
/application/layout/script/template2variation2.phtml
可以看到,如何難以管理,這是 ,所以我想在此結構之下進行管理
/application/layout/script/template1/partial/banner.phtml
/application/layout/script/template1/partial/footer.phtml
/application/layout/script/template1/variation/1.phtml
/application/layout/script/template1/variation/2.phtml
/application/layout/script/template2/partial/banner.phtml
/application/layout/script/template2/partial/footer.phtml
/application/layout/script/template2/variation/1.phtml
/application/layout/script/template2/variation/2.phtml
好界定諧音是沒有問題的,你可以使用$this -> render($this -> getTemplateName()."/partials/banner.phtml");
它的變化,這是主要問題 我用$this -> _helper -> layout -> setLayout('template1variation1');
之前,但現在,我不能使用它的新事物。
我該怎麼做這件事?