I am trying to implement a templating sytem in zend framework.
I basically use to put all the partials files and template variation in one file, but as the templates are increasing this is beign highly unmanageable.
for example
/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
You can see, how unmanageable this is
so i want to manage it under this structure
/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
Well defining the partials is not a problem, you can just use $this -> render($this -> getTemplateName()."/partials/banner.phtml");
Its the variations, that is main problem
I used $this -> _helper -> layout -> setLayout('template1variation1'); before, but for the new thing I can’t use it, now.
How can i do something this?
You can also define a complete path in your
layoutfunction.One Other way to do this task is to disable layout for your current action and then render it to any phtml file. For example first
disablelayout for current actionThen just render to any html file like this