Merge pull request #34 from craigjbass/patch-1

Allow each helper to accept PHP Generators
This commit is contained in:
Behrooz Shabani 2014-01-16 06:58:48 -08:00
commit 0f65f12db3

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) {