assign() and null-values

From: Date: Wed, 08 Jan 2003 16:00:39 +0000
Subject: assign() and null-values
Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-503@lists.php.net to get a copy of this message
Greetings! I've noticed a small problem with the assign-function and null-values. For example, look at this loop in a template: {foreach item=entry from=$entries} {assign var="foo" value=$entry.title} {if $foo} The title is {$foo} {/if} {/foreach} This will work fine as long as every entry has a title, BUT if some entry has null as title null, assign won't do anything and keep the old value. Wouldn't a better solution be to clear_assign a variable if a null-value is supplied? Nichlas

« previous php.smarty.dev (#503) next »