{* do this somewhere at the top of your template *} {assign var="title" value=$title|default:"no title"} {* if $title was empty, it now contains the value "no title" when you print it *} {$title}
详情搜索smarty手册中
Default Variable Handling
{* do this somewhere at the top of your template *} {assign var="title" value=$title|default:"no title"} {* if $title was empty, it now contains the value "no title" when you print it *} {$title}
详情搜索smarty手册中
Default Variable Handling