ZF-1545: Allow setting of arbitrary Request/Response objects on ViewRenderer
At present ViewRenderer maintains a singular relationship with a specific Zend_Controller_Action instance, which it relies upon for the initial capture of Request/Response objects. It then uses the Request object for all subsequent ViewScriptSpec formatting. Likewise it always uses the same Response object for capturing output. The problem is that this makes dispatching additional Actions (e.g. nested) which require the ViewRenderer extremely difficult. It can be worked around to some extent within a Controller class action method - outside this it's not possible. This limits reuse of controllers since the extra View management logic needs to be tacked on later when/if needed.
Adding setRequest()/setResponse() methods would help alleviate this problem, and allow programmers to temporarily override the initial objects with custom ones to enable more flexible rendering options.
As an aside, this problem is the same one afflicting the Widget View Helper example on the issue tracker. The Widget cloned Request object is never utilised by the ViewRenderer (once the request is set it's not updated from the controller) so it keeps trying to render the exact same template over and over.