ZF-11803: Wrong view base path in ViewRenderer

Description

Hi, I'm trying to use Twig as view renderer in Zend with modular convention. I created a class extends Zend_Application_Resource_View and it loads Twig in getView function.

Problem ; In Zend_Controller_Action_Helper_ViewRenderer, _viewBasePathSpec property points to ':moduleDir/views' folder. But in standard modular convention, view scripts placed in ':moduleDir/views/scripts' folder. (CLI tool creates this folder for placing views.)

--

PS : I solved this problem with overwriting default value ;

Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer')->setView($view)->setViewSuffix('suffix')->setViewBasePathSpec(':moduleDir/views/scripts');

Comments

This cannot be fixed in ZFv1 without introducing possible backwards-compatibility issues. Those implementing alternative view renderers with ZFv1 will have to be responsible for setting up the configuration accordingly, as the OP's edit demonstrates