I had a similar problem, but I was doing something a bit different:
In my bootstrap file, I was creating and configuring the View immediately
before creating an MVC instance of Zend_Layout, which in itself is alright I
guess.
The problem I had was that my Zend_Layout config is using a layout
controller plugin which was ALSO creating and configuring its own View
object.
Example:
In Bootstrap.php -
$objView = new Zend_View;
$objView->setEncoding('UTF-8');
$objView->doctype('XHTML1_TRANSITIONAL');
$objView->addHelperPath('D:/WWW/bugzmore/private/lib/My/View/Helper',
'My_View_Helper_');
$objView->setScriptPath(ROOT_PATH.'/private/modules/' . $moduleName .
'/views/content/');
$objViewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
$objViewRenderer->setView($objView);
Zend_Controller_Action_HelperBroker::addHelper($objViewRenderer);
In My_Layout_Controller_Plugin_Layout (Layout.php) -
$objView = new Zend_View;
$objView->setEncoding('UTF-8');
$objView->doctype('XHTML1_TRANSITIONAL');
$objView->setScriptPath(ROOT_PATH.'/private/modules/' . $moduleName .
'/views/content/');
$objViewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
$objViewRenderer->setView($objView);
Zend_Controller_Action_HelperBroker::addHelper($objViewRenderer);
As you can see, the code for the View in both files is exactly the same,
except that I was trying to add the helper path in Bootstrap.php, which was
apparently getting overridden in Layout.php, so all I did to fix the problem
was remove all the View stuff from Bootstrap.php (no point in having it in
two locations!) and added the helper path to
My_Layout_Controller_Plugin_Layout()
I'm not sure if that's the best-practice way of solving the problem (I'd
love to hear from someone on what they would've done in my particular
circumstance), but it definitely worked for me. Everything's running as it
used to.
So I guess, in summary, if you're having this problem and nothing else seems
to be working, make sure you're not creating your View in two different
places.
Hope that helps someone.
--
View this message in context:
http://www.nabble.com/Problems-with-View-Helpers-with-update-1.5.1-to-1.7.1-tp20807841p21182480.html
Sent from the Zend Framework mailing list archive at Nabble.com.