-- David Mintz <[EMAIL PROTECTED]> wrote
(on Thursday, 04 September 2008, 04:49 PM -0400):
> I am trying to disable autorendering under certain conditions in a plugin
> preDispatch() method. I thought this would work:
> 
>      Zend_Controller_Action_HelperBroker::getExistingHelper('ViewRenderer')->
> setNoRender();

Nope, won't work that way. The reason is that during the controller
init(), the noRender flag is reset to off. You'll need to set the
neverRender flag, which disables globally, when doing this from a
plugin.

> And this code is executing when I expect it to. But when a controller action 
> is
> invoked for which autorendering should be turned off, I am still getting a
> "script foo/bar.phtml not found in path" exception. I tried getStaticHelper(),
> same result. I have read the relevant docs but frankly I don't really get it.
> 
> I _can_  disable autorender in fooController's init() or within barAction() by
> accessing the helper broker as $_helper. But I am trying to do it this way
> because it seems more DRY.
> 
> btw, I also notice that the setNoRender() line in the plugin executes not once
> but twice. This is in an Ajax call and I can't see any reason why this should
> happen -- there's no reiteration of the dispatch loop AFAIK.

I'm not sure what you mean here...

-- 
Matthew Weier O'Phinney
Software Architect       | [EMAIL PROTECTED]
Zend Framework           | http://framework.zend.com/

Reply via email to