第一次运用smarty出错来看看吧!大侠们 设置template目录有可读写权限 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <?php include ("./Smarty/libs/Smarty.class.php");//包含smarty类文件$smarty = new Smarty(); //建立smarty实例对象$smarty$smarty->template_dir = './templates';$smarty->compile_dir = './templates_c';$smarty->config_dir = './configs';$smarty->cache_dir = './cache';$smarty->caching = false;$smarty->left_delimiter = "<{"; $smarty->right_delimiter = "}>";$smarty->assign("title", "垃圾"); //进行模板变量替换$smarty->assign("content","测试用的网页内容00"); //编译并显示位于./templates下的index.tpl模板$smarty->display("index.tpl"); //index.tpl ?> 应该是保证templates_c有读写权限,在templates\index.tpl这个文件确定存在的前提下。 呵呵,好久没在windows下面配置了,好像是共享该文件夹并且允许everyone r/w吧(其实应该是给通过IIS访问的用户权限,但everyone简便些,呵呵)linux下面就chmod templates_c 777就可以了 关与跨域请求 我要开始学PHP了 PHP session 入 mysql 需要锁表吗? php中有没有向右取字符串的函数 PHP如何连接远程数据库? file_get_contents读取xls一片乱码? 根据单选框的选择,提交到不同页面碰到的问题--菜鸟请教 为什么有的分页代码能刷新,有的不能刷新? Function registration failed -----------300分求源代码:文件上传-------------- 求一关于编码的正则 在win2003上装mysql5.X 死活都链接不上,请教是什么问题?
include ("./Smarty/libs/Smarty.class.php");//包含smarty类文件
$smarty = new Smarty(); //建立smarty实例对象$smarty
$smarty->template_dir = './templates';
$smarty->compile_dir = './templates_c';
$smarty->config_dir = './configs';
$smarty->cache_dir = './cache';
$smarty->caching = false;
$smarty->left_delimiter = "<{";
$smarty->right_delimiter = "}>";
$smarty->assign("title", "垃圾"); //进行模板变量替换
$smarty->assign("content","测试用的网页内容00");
//编译并显示位于./templates下的index.tpl模板
$smarty->display("index.tpl"); //index.tpl
?>