$data1 = $smarty->createData();
$data2 = $smarty->createData();
$data1 -> assign('nav','data1的nav');
$data2 -> assign('nav','data2的nav');
$smarty->display('header.tpl',$data1);
$smarty->display('footer.tpl',$data2);
注意 assign 以前使用 smarty对象,而现在则使用数据对象来调用