-
Notifications
You must be signed in to change notification settings - Fork 275
Open
Milestone
Description
The changes from #629 seem to throw unnecessary errors.
Following template should always run even if lie
isn't defined and strict_variables
is enabled - just the output should change:
The {{ baked_good }} is a{% if lie is defined and lie %} lie {% else %} reality {% endif %}!
However, with strict_variables
enabled it fails with TwigException: Variable "lie" does not exist.
Running Example: https://jsfiddle.net/jsz9uy3h/6/
If you use https://cdn.jsdelivr.net/npm/twig@1.13.3/twig.min.js in above fiddle it works.
For the moment I can only think of introducing context awareness into the parse
function of Twig.expression.type.variable
. However this seems like a good way to clutter things :|
minhphuc429, mimol91, dorian-marchal, Swahjak, julkue and 4 more