ZF-2819: Allow ViewScript decorator to have access to content and to replace it

Issue Type: New Feature Created: 2008-03-06T19:42:43.000+0000 Last Updated: 2008-03-21T16:25:48.000+0000 Status: Resolved Fix version(s): - 1.5.0 (17/Mar/08)

Reporter: Matthew Weier O'Phinney (matthew) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Form

Related issues: Attachments:


Several people have requested the ability to have access to decorator content within the view script rendered by the ViewScript decorator, as well as the ability to replace the content provided to it. This can be accomplished by doing the following:

  • add an additional variable to the view, 'content';
  • add the decorator itself as the 'decorator' view variable;
  • and allow a null value for the 'placement' option, which would allow you to replace the content instead of appending or prepending it.

You would then be able to either:

  • pass a null 'placement' option to the decorator at initialization
  • in your view script, call $this->decorator->setPlacement(null)

in order to make the content of the view script replace it.


Posted by Matthew Weier O'Phinney (matthew) on 2008-03-07T14:47:24.000+0000

Works as per the bullet points in the posted issue, with the exception that the value 'false' should be passed as the 'placement' decorator option when desiring to replace content.

Applied to trunk and 1.5 release branch.

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.