Re: [SMARTY] 'bool' in a template

From: Date: Mon, 29 Jul 2002 01:22:42 +0000
Subject: Re: [SMARTY] 'bool' in a template
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-5488@lists.php.net to get a copy of this message
I'd use this one: {if $foo} Gerard Samuel wrote:
I have this function that returns TRUE or FALSE and is fed into the template. On the template side, Im wondering how the template syntax handles bool strings. When I echo out the string it returns 1. Im not sure if 1 is considered as TRUE or the interger 1 in the template. In php code I usually test bools by using ===. I didn't see === in the manual, but smarty isn't complaining when I tried it in the template. So which would be the correct way {if $foo == 1} {if $foo == '1'} {if $foo === TRUE} Again, all 3 methods seem to work, but I didn't find any info in the manual, so Im looking for confirmations.... Thanks


« previous php.smarty.general (#5488) next »