I am trying to add a new path to my view scripts in a preDispatch plugin.
My ultimate goal is to run several sites from the same Zend Framework application each with their own layout and view scripts. However I wish to use the default layout/views where a site does not have its own view/layout.
I have got the layout to work correctly but I cannot get the view scripts to load.
My views folder layout is as follows
/application
/modules
/views
/scripts
/index
index.phtml -> the default index controller view script
/sites
/domingod -> this is a site
/index
/index.phtml -> the sites index controller view script
What I am trying to achieve is for the index view script in domingod/index/index.phtml to be loaded, if this file is not found the I want the default index.phtml view script to render.
I have tried this so far but with no luck
Zend_Layout::getMvcInstance()->getView()->setScriptPath($viewScriptPath);
This seems to add the path but ZF is still rendering the default index.phtml rather than the sites (domingod) one.
I hope this all makes sense, many thanks in advance.
Garry