Issues

ZF-102: Zend_View_Abstract: public clearParams() requested (TRAC#100)

Issue Type: Improvement Created: 2006-06-21T21:48:55.000+0000 Last Updated: 2007-07-05T14:43:09.000+0000 Status: Resolved Fix version(s): - 0.6.0 (16/Dec/06)

Reporter: Zend Framework (zend_framework) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_View

Related issues: Attachments: - ZF-102.patch

Description

http://framework.zend.com/developer/ticket/100

I use the registry in my index.php to create a singleton instance of Zend_View. I then set the view's variables in my controllers and render. However, sometimes I want to render two views in a single page request, like so:

<pre class="highlight">
someAction() {
    $view = Zend::registry("view");
    $view->firstName = "Roger";
    $view->lastName = "Moore";
    echo $view->render("showPerson.php");

    /* I would like the ability to clear view parameters from a
       controller so that the second call to render does not have
       access to the first call to render's parameters:

       $view->clearParams();
     */

    $view->header = "Data table";
    $view->tableData = array(...);
    echo $view->render("showDataTable.php");
}

The issue with constructing a new Zend_View for every render is that there are many settings (setViewPath(), addHelperPath(), etc.) that would have to be set several times in the same *Action() method.

Comments

Posted by Keith Pope (mute) on 2006-07-17T12:38:14.000+0000

Patch for this issue, added public method clearParams()

Posted by Matthew Weier O'Phinney (matthew) on 2006-11-07T11:49:13.000+0000

Implemented as clearVars() (to be consistent with naming scheme in Zend_View), and added in revision 1481.

Have you found an issue?

See the Overview section for more details.

Copyright

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

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

Contacts