Allow each helper to accept PHP Generators

This commit is contained in:
Craig Bass 2014-01-16 13:29:10 +00:00
parent 94fbc01217
commit 689c9e51de

View File

@ -117,7 +117,7 @@ class Helpers
$tmp = $context->get($args);
$buffer = '';
if (is_array($tmp) || $tmp instanceof \Traversable) {
$islist = (array_keys($tmp) == range(0, count($tmp) - 1));
$islist = ($tmp instanceof \Generator) || (array_keys($tmp) == range(0, count($tmp) - 1));
foreach ($tmp as $key => $var) {
if ($islist) {