ZF-9465: Zend_Application_Resource_View doesn't use static helper broker (new discussion over the bug #ZF-8778)


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


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.


added patch to fix problem

Fix with issue ZF-11579.