You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{#myeach '[{"a":"ayy", "b":"bee"},{"a":"zzz", "b":"ccc"}]' as | newContext index | }}
Foo {{newContext.a}} {{index}}
{{/myeach}}
The Issue:
As in the example I have a custom each helper. When I attempt to use the as | value index| syntax as described in handlebars documentation it does not work. this will return the object that was pulled from the JSON okay, but newContext and index print nothing. Such that the rendered output is simply Foo Foo
Do I need additional flags to enable this? What am I doing wrong here?
The text was updated successfully, but these errors were encountered:
theodorejb
added a commit
to devtheorem/php-handlebars
that referenced
this issue
Mar 31, 2025
In order for this to work the block parameters have to be explicitly passed to the fn() block renderer. This can be done with PHP Handlebars as follows:
The PHP Code:
Template:
The Issue:
As in the example I have a custom each helper. When I attempt to use the
as | value index|
syntax as described in handlebars documentation it does not work.this
will return the object that was pulled from the JSON okay, butnewContext
andindex
print nothing. Such that the rendered output is simplyFoo Foo
Do I need additional flags to enable this? What am I doing wrong here?
The text was updated successfully, but these errors were encountered: