Details
Description
I have a model that implements SeekableIterator and Countable so I can use it like an array
When I do a foreach($designs as $design) {} loop I get back the proper value in $design which is an object model containing all the info about a design..but when I do this
<?= $this->partialLoop('view/design.phtml', $this->designs); ?>
I found the problem and noticed that it was doing this when it ran across an object
} elseif (is_object($model)) {
If (method_exists($mode, 'toArray')) {
$view->assign($model->toArray());
} else {
$view->assign(get_object_vars($model));
}
}
What i did to patch it for my code is when there is no toArray method it just assigns the object to a variable named object.
} elseif (is_object($model)) {
If (method_exists($mode, 'toArray')) {
$view->assign($model->toArray());
} else {
$view->assign('object', $model));
}
}
Now i understand this is by no means a final solution but it works for now.
here is a link to the thread on the mailing list where it is being discussed.
http://www.nabble.com/Question-about-PartialLoop%28%29-usage-to14739402s16154.html#a14739402
Attachments
Issue Links
| This issue is related to: | ||||
| ZF-3285 | Zend_View_Helper_PartialLoop turns all objects into array even when the objectKey is set |
|
|
|
Added Patch file.