lint.inc.php文件
<?php
require("../libs/Smarty.class.php");
define(ROOT,'D:/wamp/www/smarty/smarty');
//创建模板对象
$tpl = new Smarty();
$tpl->template_dir = ROOT.'/tpl';
$tpl->compile_dir = ROOT.'/tpl_c';
$tpl->left_delimiter = '<{';
$tpl->right_delimiter ='}>';
?>
b.php文件
<?php
include("../init.inc.php");
$title="smarty学习";
$content="smarty模板的介绍";
//分配变量
$tpl->assign("title",$title);
$tpl->assign("content",$content);
//调用模板文件
$tpl->display("./tpl1/a.tpl");
?>