Closed ilyapuchka closed 6 years ago
Before I forget: This PR should document the changes in the docs
.
@djbe @kylef comments addressed, can you look again?
@ilyapuchka why close this? The docs are there, it should be GTM.
there were conflicts and tests started to fail for some reason after I merged, I'll need to to investigate that but I also don't feel like this is a top priority considering other open PRs
Which tests? CI succeeds for the latest commit in this PR.
Only because I didn't push 😉
This PR adds ability to resolve boolean expressions the same way as variables like
{{ this == that }}
This have a potential to simplify templates when there is a need to evaluate boolean expression and output its result, true or false, in a template, i.e. when generating html to enable or disable html elements. Instead of
{% if this == that %}true{% else %}false{% endif %}
it will be possible to write just{{ this == that }}
Also this PR adds support for parsing static boolean expressions, i.e. if
{% if true %}
. There was implementation for such expression and tests for it, but it was never actually parsed. It may not be very important, but can be helpful during template development.