include "../libs/Smarty.class.php"; //引用smarty包
可在官网下载最新的版本 http://www.smarty.net/
然后建立个php程序
require('Smarty.class.php');
$smarty = new Smarty;
$smarty->template_dir = '/web/smarty/templates/'; //设置模版目录
$smarty->compile_dir = '/web/smarty/templates_c/';//设置编译模版目录
$smarty->config_dir = '/web/smarty/configs/';
$smarty->cache_dir = '/web/smarty/cache/';//模版缓存地址
$smarty->assign('name','Ned');
$smarty->display('index.tpl');
然后在web/smarty/cache/新建一个index.tpl文件