Re: [fw-general] Nested Calls to Zend_View View Action Helper

2008-02-20 Thread Matthew Weier O'Phinney
-- Dan Dorman <[EMAIL PROTECTED]> wrote
(on Wednesday, 06 February 2008, 02:09 PM -0800):
> Dan Dorman wrote:
> > The action functions aren't getting called twice, the output of the last
> > function is simply being prepended to the desired output for some reason.
> 
> After digging around the Zend Framework code, I discovered the culprit: the
> Zend_View action helper clones the response object and then clears its body
> before appending text. However, when the nested call returns to the outer
> call, it ends up appending the text to the same response object.
> 
> Adding another call to resetObjects after the response is returned fixes the
> problem, but is there a way around this without resorting to altering the ZF
> code directly? I tried doing something similar in the postDispatch method of
> my controller objects, but it was too late by that point.
> 
> Any other ideas or guidance would be great.

Actually, the call to resetObjects wasn't the issue. There was something
fundamentally broken about the Standalone container's implementation
that basically allowed multiple copies of the same placeholder to exist.
I've fixed the implementation in trunk; please test and let me know if
it solves your issues.

-- 
Matthew Weier O'Phinney
PHP Developer| [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/


Re: [fw-general] Nested Calls to Zend_View View Action Helper

2008-02-06 Thread Dan Dorman


Dan Dorman wrote:
> 
> The action functions aren't getting called twice, the output of the last
> function is simply being prepended to the desired output for some reason.
> 

After digging around the Zend Framework code, I discovered the culprit: the
Zend_View action helper clones the response object and then clears its body
before appending text. However, when the nested call returns to the outer
call, it ends up appending the text to the same response object.

Adding another call to resetObjects after the response is returned fixes the
problem, but is there a way around this without resorting to altering the ZF
code directly? I tried doing something similar in the postDispatch method of
my controller objects, but it was too late by that point.

Any other ideas or guidance would be great.
-- 
View this message in context: 
http://www.nabble.com/Nested-Calls-to-Zend_View-View-Action-Helper-tp15281249s16154p15313463.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Nested Calls to Zend_View View Action Helper

2008-02-04 Thread Dan Dorman

Suppose I have a phtml file that features something like:

action('index', 'nav') ?>

Say NavController implements three actions: indexAction, widgetOneAction,
and widgetTwoAction; indexAction does nothing but render the following view
script:

start
action('widgetOne', 'nav') ?>
action('widgetTwo', 'nav') ?>
end

When I try this, the eventual output ends up looking something like this:

[output of widgetTwo]
start
[output of widgetOne]
[output of widgetTwo]
end

If the order of widgetOne and widgetTwo are switched, then widgetOne's
output gets duplicated instead. If either call is eliminated, the remaining
widget gets its output duplicated. The action functions aren't getting
called twice, the output of the last function is simply being prepended to
the desired output for some reason. Can anybody help me understand why this
is?

Is nesting calls to the view action helper even a good idea? What is the
preferred way of implementing behavior like this?
-- 
View this message in context: 
http://www.nabble.com/Nested-Calls-to-Zend_View-View-Action-Helper-tp15281249s16154p15281249.html
Sent from the Zend Framework mailing list archive at Nabble.com.