ZF-2403: Zend_View_Helper_Head* muilt view support

Issue Type: Bug Created: 2008-01-09T13:20:08.000+0000 Last Updated: 2008-03-21T16:25:28.000+0000 Status: Resolved Fix version(s): - 1.5.0 (17/Mar/08)

Reporter: Jon Whitcraft (sidhighwind) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_View

Related issues: - ZF-2399



When you call

<pre class="highlight">

inside an action and the index2 action calls this

<pre class="highlight">

whatever is added with head* helper in the second action does not get appended to the layout when it's rendered.


Posted by Matthew Weier O'Phinney (matthew) on 2008-01-09T15:12:03.000+0000

When you say "inside an action", do you mean inside an action controller method? I need more context.

The action() view helper by itself does not act as a placeholder, it simply returns content; as such, if you want it to appear in the layout script, you need to either put it in a placeholder, or include it in content that will be aggregated into the layout.

Posted by Jon Whitcraft (sidhighwind) on 2008-01-09T19:08:51.000+0000

Ok here is what i do.

i request a page lets say

In my setup that would make it Module of news controller of story and the defualt index action as My_Story is the title of the story which is how I know which story to fetch from the db. inside of the index action i call get the story and assign it to a view.

inside of my view script i have the code to out put the story.

at the bottom of the view script i call this code.

<pre class="highlight">
<?= $this->action('index', 'news', 'talkback', array('story_id' => $this->story->release_id)) ?>

which call the talkback module news controller index action which if talkback exists for the passed in release then it will spit out the necessary code for the talkback module on the page.

The way i think this should work is that i should beable to specify any addition css/js/meta data that is needed in that action even though it's begin call through the action helper.

Doest that make sense?

Posted by Matthew Weier O'Phinney (matthew) on 2008-01-29T14:13:29.000+0000

When you say "inside of my view script", is this the view script rendered for the action, or your layout script?

If the call to $this->action() is occurring in your layout script, then this won't work; it's being executed after the other helpers have already created their output. If it's happening in your view script, but before the layout script is rendered, then there's a definite issue.

Could you confirm the sequence of events?

Posted by Jon Whitcraft (sidhighwind) on 2008-01-29T15:02:32.000+0000

it it called from the action and not the layout.

so i call $this->render('designs') at the end of an action to render the designs.phtml for the current module. Inside side of that i have the $this->action('design_nav','navigation','designid', array()) call to render the local navigation or some other piece of this page. but when i try add scripts or css files from that action they do not get added.

does that make sense?

Posted by Matthew Weier O'Phinney (matthew) on 2008-02-01T11:26:55.000+0000

Changing release target to next minor release, as functionality will not be released before then.

Posted by Matthew Weier O'Phinney (matthew) on 2008-02-19T16:30:34.000+0000

Resolved in trunk; please test.

Have you found an issue?

See the Overview section for more details.


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

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