'bool' in a template
| From: | Gerard Samuel | Date: | Sun, 28 Jul 2002 23:24:30 +0000 |
| Subject: | 'bool' in a template | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-5485@lists.php.net to get a copy of this message | ||
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
--
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/