leaf-kit
leaf-kit copied to clipboard
loop over custom tag result
In Leaf 3 we could loop not just over arrays from context, but we also could loop over custom tag result
Now in Leaf 4:
-
#for(language in #config("app", "languages")):
Throws exception:LeafKit.LexerError.Reason.invalidParameterToken(\"#\")
-
#for(language in config("app", "languages")):
Throws:"for loops expect single expression, 'name in names'"
I'm seeing the same issue with the Nodes Flash package. I was expecting to be able to use the following in my templates (where flashes()
is the custom tag):
#for(flash in flashes().all):
#endfor
@0xTim here you go, for the flashes library 🫡