Hi all,
after some illogical results in my templates I've made a short test snippet which I think should produce a different result:
a.html.volt
{% include 'b.html' with [ testVar : false ] %}
b.html.volt
{{ dump(testVar) }}
{{ dump(testVar|default(true)) }}
Rendering A will then produce:
bool(false) bool(true)
According to phalcon documentation it's behaving as expected:
Sets a default value in case that the evaluated expression is empty (is not set or evaluates to a falsy value)
How can I accomplish what my code is trying to do? I need to be sure that, even if not defined, testVar, should be evaluated as a bool, defaulting to true.
Thanks Gianluca