Issues

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

Issue Type: Bug Created: 2008-05-17T23:18:35.000+0000 Last Updated: 2008-10-11T09:06:48.000+0000 Status: Resolved Fix version(s): Reporter: Christopher Manning (manningc) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_View

Related issues: - ZF-2431

Attachments:

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 partialLoop(); $partial->setObjectKey('model'); print $partial->partialLoop('mypartial.phtml', $this->dbRowset); ?>

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

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts