empty in smarty_mod_debug_print_var
| From: | Maciej Uhlig | Date: | Fri, 01 Feb 2002 09:42:27 +0000 |
| Subject: | empty in smarty_mod_debug_print_var | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-2636@lists.php.net to get a copy of this message | ||
I think the empty test:
if (empty($var)) {
return '<i>empty</i>';
}
in smarty_mod_debug_print_var is misleading. I got 'empty' and I was
expecting the variable is '' while the variable was equal to '0'. For me
this is not empty variable but a variable with char 0 value. I know PHP
manual definition of empty(), but I feel something has to be done with this,
for instance:
if (!isset($var)) {
return '<i>unset</i>';
}
if of course there may be unset variables in the template or
if ( '' == $var)) {
return '<i>empty</i>';
}
you'll better know what to do with it :-)
Maciek