NYCPHP Meetup

NYPHP.org

[nycphp-talk] How do other templates handle NULL/empty vars?

jon baer jonbaer at jonbaer.net
Thu Nov 13 10:59:14 EST 2003


this is not really a big deal, but i was wondering how other template
engines besides Smarty deal w/ null,empty characters when using "default"
settings ... for example:

$val = '';
$smarty->assign('code',$val);
$smarty->display('code.tpl');

{$code|default:"N/A"}

in Smarty a non-existant(NULL) or length of 0 would give me the default but
might not always be the case on what id want (for example if it exists but
the length is really 0) ...

- jon

pgp key: http://www.jonbaer.net/jonbaer.asc
fingerprint: F438 A47E C45E 8B27 F68C 1F9B 41DB DB8B 9A0C AF47




More information about the talk mailing list