Suppose I have a phtml file that features something like:

<?= $this->action('index', 'nav') ?>

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

<p>start</p>
<?= $this->action('widgetOne', 'nav') ?>
<?= $this->action('widgetTwo', 'nav') ?>
<p>end</p>

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

[output of widgetTwo]
<p>start</p>
[output of widgetOne]
[output of widgetTwo]
<p>end</p>

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.

Reply via email to