Zend's partial view helper is great because it allow you to reuse the same HTML code repeatedly in multiple layouts and views but it can be used for so much more. For example, I'm working on a project that sends a large amount of email. Usually, I want to send these emails in response to something happening inside a model (new user signup, password reset, etc.). Ideally, I would be able to generate the email using the partials and not by inlining all the HTML in the model (which would have been my old approach) but you can't access the partial view helper directly from inside the model.

The code below creates a new Zend_View and sets it up so the partial view helper will work. I send out both an HTML and a text body for the emails so I create two separate view files so it's still easy to maintain.

$view = new Zend_View();
$view->setBasePath(APPLICATION_PATH . '/views/');
$emailBodyHTML = $view->partial('email/registrationEmail.phtml', array('values'=>$values));
$emailBodyText = $view->partial('email/registrationEmail.txt', array('values'=>$values));

To simplify things even more in my actual code base, I have extended Zend_Email so we only need to call one function to get this functionality.

$mail = new Application_Model_Email();
$email->setEmailBoth('registrationEmail', array('values'=>$values));