Bernhard's Blog
8 Jan
There are some Problems with the original folder Structure, when developing a system where users should be able to create their own style.
In the default MVC Folder Structure which is provided with the Zend Framework, users have to go deep into the application folder to edit them.
The Default Folder Structure:
So, who could you setup a external Folder which contains all neccesary informations for your views?
The folderstructure how it should be:
In this structure, the user only needs the template folder to change the look of the page.
Now: Initialize the Front Controller and the View to use this Folder:
In your Bootstrap or index File, you have to say the Controller to not autorender the action since this bring up a failure.
$ctrl = Zend_Controller_Front::getInstance(); $ctrl->setParam('setNeverRender', true);
In the Controllers Action part you have to set the Scriptpath:
public function indexAction() { $this->view->addScriptPath( 'Templates/Frontend/Default/Skinbits' );// render a specific Viewscript within this Action $this->view->render('viewname.phtml');}
Leave a reply