Maybe it would be better if each module had its own view script stack? That way they wouldn't interfere with each other at all.
-Hector
-Hector
On Thu, Nov 13, 2008 at 10:11 AM, Arthur M. Kang <arthur@levelogic.com> wrote:
The ViewRenderer currently checks the path stack to see if a path exists prior to adding it. This is causing a small bug for me.
If module1-controller1-action1 forwards to module2-controller1-action1, which then forwards back to module1-controller1-action1, the view path stack is incorrect. The path for module1 views is never unshifted back onto the path stack (as it already exists in there), so when rendered, it renders the views from module2.
Current Stack Result:
array(2) {
[0] => string(76) "/directory/module2/views/scripts/" [1] => string(76) "/directory/module1/views/scripts/" }Expected Stack Result:
array(3) {
[0] => string(76) "/directory/module1/views/scripts/" [1] => string(76) "/directory/module2/views/scripts/" [2] => string(76) "/directory/module1/views/scripts/" }Or
array(3) {
[0] => string(76) "/directory/module1/views/scripts/" [1] => string(76) "/directory/module2/views/scripts/" }
What I'm trying to accomplish is actions firing in a specific sequence. If we are out of sequence, need to forward to the correct action and then come back.
Simple fix is to just add paths to the view script stack WITHOUT checking if it first exists. That is my current temp fix (I just commented out $pathExists = true).
Otherwise, another fix would be, if the path exists, push it to the top of the stack.
Could somebody let me know if this is expected behavior and if I'm doing something out of whack?
Thanks.
Arthur
没有评论:
发表评论