ZF-3828: ViewRenderer render actions with wrong view script when used with actionStack and multiple modules

Issue Type: Bug Created: 2008-08-01T14:23:49.000+0000 Last Updated: 2011-08-13T22:11:03.000+0000 Status: Open Fix version(s): Reporter: Patrick Barroca (patbator) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Controller

  • zf-crteam-padraic
  • zf-crteam-priority

Related issues: Attachments:


We create an action stack as follow :

||Module||Controller||Action|| |Module1|Index|Index| |Module3|Index|Index| |Module2|Index|Index| |Module1|Index|Index|

As dispatching takes place, ViewRenderer adds base script paths to its Zend_View object, leading to the following base paths array :

[0] => '../application/modules/module3/views/scripts/', [1] => '../application/modules/module2/views/scripts/', [2] => '../application/modules/module1/views/scripts/'

In this case the last action called, Module1/Index/Index as actionStack is LIFO, is rendered with ../application/modules/module3/views/scripts/index.phtml.

We fixed it by extending ViewRenderer and reseting base script paths array at each initView call.

By the way, this could/should be better fixed as having same action names across multiple modules is not that rare.


Posted by Patrick Barroca (patbator) on 2008-08-03T11:53:58.000+0000

typos corrected

Posted by Thomas Weidner (thomas) on 2008-08-24T14:24:52.000+0000

Assigned to right component

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.