ZF-3285: Zend_View_Helper_PartialLoop turns all objects into array even when the objectKey is set
Description
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
From:
if (is_object($model) && method_exists($model, 'toArray')) {
To:
if (is_object($model) && method_exists($model, 'toArray') && $this->_objectKey === null) {
Comments
Posted by Christopher Manning (manningc) on 2008-05-21T11:53:50.000+0000
Caused by this issue
Posted by Wil Sinclair (wil) on 2008-06-09T13:31:40.000+0000
Please evaluate and fix/categorize as necessary.
Posted by Jon Whitcraft (sidhighwind) on 2008-10-11T09:06:26.000+0000
this was fixed [http://framework.zend.com/code/changelog/…] and is a dupe of ZF-4141