smarttemplate取出子模板变量父模板却不能用,高手帮忙
//####index.php
<?
if (isset($_GET["do"]))
{
$ac = $_GET["do"];
switch($ac)
{
case "gb":
require("class/guestbook.php");
$main = $data_gb;
//echo $main;
break;
default :
$main = "无法取出数据";
break;
}
}
else
{
$main = "HOHO";
}
$tpl = new SmartTemplate("template/index.htm");
$title = "enjoy's";
$logo = "<h1>enjoy's</h1>";
$menu = "<a href='index.php'>MY首页</a> <a href='#'>品尝好文</a> <a href='#'>行业快讯</a> <a href='index.php?do=gb'>温馨留言</a> <a href='#'>音乐点播</a>";
$copyright = "enjoy's 2005";
$tpl->assign("title",$title);
$tpl->assign("logo",$logo);
$tpl->assign("menu",$menu);
$tpl->assign("main",$main);
$tpl->assign("copyright",$copyright);
$tpl->output();
?>
//####guestbook.php
<?
$action = "sendgb";
$gbT = new SmartTemplate("template/guestbook.htm");
$gbT->assign("action",$action);
$data_gb = $gbT->result();
?>
走到case "gb":这一步的时候,$main是可以取到值的
但是下面的模板就不能用了,就是值替换不了
怎么回事