I'm trying to pass a custom view into Zend_layout but am having some issues.
==bootstrap==
require_once 'Zend/Layout.php';
$view = new My_View();
$layout = Zend_Layout::startMvc(array('layoutPath' =>
'../Application/view-layouts' , 'view' => $view));
$view = $layout->getView();
$view->addHelperPath('../library/Bmb/View/Helper', 'Bmb_View_Helper');
==end==
==My View==
class My_View extends Zend_View {
}
==End==
The getView returns My_View fine, but when a page is loaded, the phtml file
seems to be getting Zend_View rather then my_view (Zend_view is returned by
a print_r($this)).
This is causing issues with helpers as the HelperPath seems to be added to
My_view but not Zend_view.
Can anyone advise on why a different instance of Zend_View seems to be
instantiated? would it be something to do with calling $this->render()
within the layout?
Thanks
--
View this message in context: http://www.nabble.com/Passing-Custom-View-into-Zend-Layout-Fails-tp21664006p21664006.html
Sent from the Zend MVC mailing list archive at Nabble.com.
没有评论:
发表评论