Hello,
I have a problem in latte template how to properly identify zero and false value in {if}, for example:
<?php // $foo may by false or a number from zero $this->template->foo = false; // or $this->template->foo = 0; ?>
in Latte template:
{if $value}
is still false.
Anybody help me? Thank you.
Last edited by heximcz (2016-04-06 01:00)
In latte, you can use (almost) any php expression. in your case:
{if $value !== false}
BTW:
{if $foo !== false}
Latte knows nothing about $value property.