public $view;
public function setView(Zend_View_Interface $view)
{
$this->view = $view;
}
$view = Zend_Controller_Action_HelperBroker::getExistingHelper(‘viewRenderer’)->view;
Then you can set variables for your view scripts and render them like this:
$view->someVar = “someValue”;
$out = $view->render(“path/to/viewScript.phtml”);
return $out;
This saves you from having to create a brand new Zend_View and trying to figure out how to set the basepath in a portable way. You do need to be mindful of the fact that you aren’t creating a new namespace for your partial so be ware of variable name clashes. Since you are reusing the same view your controller is using, anything you set using $this->view->whatever will also be available in your partial view script as $this->whatever.
]]>