ZF-9465: Zend_Application_Resource_View doesn't use static helper broker (new discussion over the bug #ZF-8778)
Description
In bug #ZF-8770 Andrew Stoltz asked to fix using "new view renderer" instead of calling static one.
why did this bug marked as "not an issue"?
i have a big problem with it in such case: in application.ini I setup:
resources.view.helperPath.CU_View_Helper = APPLICATION_PATH "/views/helpers/CU/View/Helper"
resources.view.helperPath.ZendX_JQuery_View_Helper = ZendX/JQuery/View/Helper
then in bootstrap class:
protected function _initActionHelpers() {
Zend_Controller_Action_HelperBroker::getStaticHelper('contextSwitch')->AddContext('widget', Array('suffix'=>'widget'));
}
after this all queries with '&format=widget' have wrong output! ViewRenderer output *.phtml template instead of *.widget.phtml
if move contextSwitch initializer in another place (for example in controller init function) all work ok.
such behaviour explains by ContextSwitch helper call
Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
only once and store pointer to in as a private attribute. and if it happens before Zend_Controller_Action_Helper_ViewRenderer called, it causes errors.
Comments
Posted by Stephan Kountso (steplg) on 2010-03-18T09:59:11.000+0000
added patch to fix problem
Posted by Ramon Henrique Ornelas (ramon) on 2011-07-30T03:24:50.000+0000
Fix with issue ZF-11579.