ZF-3285: Zend_View_Helper_PartialLoop turns all objects into array even when the objectKey is set


Zend_View_Helper_Partial allows an $_objectKey to be set; this is helpful since it allows you to call functions on the object in the partialLoop

The below example worked in 1.5.1 but now fails in 1.5.2 since $this->model is turned into an array.

myview.phtml <?php $partial = $this->partialLoop(); $partial->setObjectKey('model'); print $partial->partialLoop('mypartial.phtml', $this->dbRowset); ?>

mypartial.phtml <?php $this->model->function(); ?>

I propose editing L:70 of Zend_View_Helper_PartialLoop


if (is_object($model) && method_exists($model, 'toArray')) {


if (is_object($model) && method_exists($model, 'toArray') && $this->_objectKey === null) {


Caused by this issue

Please evaluate and fix/categorize as necessary.

this was fixed [http://framework.zend.com/code/changelog/…] and is a dupe of ZF-4141