有2个模板文件a.tpl和b.tpl其中a.tpl里有{$aaa}标签
b.tpl为随意内容
<?php
$smarty = new Smarty;
$smarty->compile_check = true;
$smarty->assign('aaa','这里加入b.tpl的内容');
$smarty->display('a.tpl');
?>
这样怎么弄?
b.tpl为随意内容
<?php
$smarty = new Smarty;
$smarty->compile_check = true;
$smarty->assign('aaa','这里加入b.tpl的内容');
$smarty->display('a.tpl');
?>
这样怎么弄?
$smarty->assign('aaa','这里加入b.tpl的内容');
是动态的
所以要在程序里加
$con=$smarty->fetch("test.tpl",null,null,false);$smarty->assign('aaa','这里加入'.$con.'的内容');
$smarty->display('a.tpl');这样就可以了!