ZF-102: Zend_View_Abstract: public clearParams() requested (TRAC#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:

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->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.


Patch for this issue, added public method clearParams()

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