新浪Sea使用Smarty的解决方法.
2012-10-30 19:14 Tuesday  

分类: PHP 标签: 使用 smarty 会报 templates path 评论(42) 浏览(82233)

$path="saemc://templates_c";//使用MC Wrapper
//此项必须,网上很多解决的方式都没有下面这句,造成目录不存在的错误出现.
mkdir($path); 
$smarty = new Smarty();  
$smarty->template_dir = "./templates"; 
$smarty->compile_dir = $path; //设置编译目录
@$smarty->display("sample.tpl");
//直接使用smarty会报chmod错误,这个错误不会影响到smarty的使用 请加@忽略 

+1 15

留下你的看法: