>>602
もしかしてこんな感じで解決しない?

if(...) {
$a=1;
} else {
$a=2;
}
$smarty->assign('a',$a);