-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For tag does not support condition #45
Comments
thanks, that you fixed it so fast. But it has some minor flaw:
The template has to output 4 times the "match!" string but does throw an error |
I'm not surprised there's a bug in the implementation, what I committed is not well tested yet. I'll be working on it more this evening. |
Ah okay, say when you're done and i try the implementation |
Also, you need to quote keys in object literals: (unquoted keys are new as of twig 1.5 which released after I wrote the object literal parser in twig.js, so they're not supported yet) {% set known_values = [{'val': 'a'}, {'val': 'b'}, {'val': 'c'}] %} |
It looks like the for loop was doing the correct thing, it was the unquoted object keys that were causing the error. I've added support for them, so your example should work now. |
This is fixed and available in 0.4.6. |
Hi,
me again. You've done great work but i've found another bug. The twig manual describes how to use a condition inside a for loop. The implementation notes page for twig.js states that the for tag is "supported" but it does not support conditions inside a for tag.
Testcode:
Expected output:
Real behaviour:
The text was updated successfully, but these errors were encountered: