smarty 安装配置

引入smarty.class.php

include $root."Smarty/libs/Smarty.class.php";

建立对象

$smarty = new Smarty;

 设置目录

$smarty->setTemplateDir($template_dir); //设定所有模板文件都需要放置的目录地址。
$smarty->setConfigDir($config_dir);//设定用于存放模板特殊配置文件的目录,
$smarty->setCacheDir($cache_dir); //在启动缓存特性的情况下,这个属性所指定的目录中放置Smarty缓存的所有模板 
$smarty->setPluginsDir($plugins_dir);//插件目录
$smarty->setCompileDir($compile_dir); //设定Smarty编译过的所有模板文件的存放目录地址    

 

posted @ 2012-08-01 11:50  break_happy  Views(249)  Comments(0)    收藏  举报