mirror of
https://github.com/Mibew/handlebars.php.git
synced 2024-11-15 08:44:12 +03:00
Allow each helper to accept PHP Generators
This commit is contained in:
parent
94fbc01217
commit
689c9e51de
@ -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