mirror of
https://github.com/Mibew/handlebars.php.git
synced 2025-04-16 03:17:24 +03:00
Merge pull request #34 from craigjbass/patch-1
Allow each helper to accept PHP Generators
This commit is contained in:
commit
0f65f12db3
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user