Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

Commit 2dbfdc2

Browse files
committed
Do not convert Traversable to array in view partials
Fix #202
1 parent 62a171f commit 2dbfdc2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Helper/Partial.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
namespace Zend\View\Helper;
1111

12+
use Traversable;
1213
use Zend\View\Exception;
1314
use Zend\View\Model\ModelInterface;
1415

@@ -53,7 +54,7 @@ public function __invoke($name = null, $values = null)
5354
$values = [$objectKey => $values];
5455
} elseif (method_exists($values, 'toArray')) {
5556
$values = $values->toArray();
56-
} else {
57+
} elseif (! $values instanceof Traversable) {
5758
$values = get_object_vars($values);
5859
}
5960
}

0 commit comments

Comments
 (0)