smarty问题??

chf99cn 2004-12-01 03:59:36

Warning: Smarty error: unable to read template resource: "test.htm" in E:\smarty\comm\Smarty.class.php on line 1040
这是什么原因??
...全文
101 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
chf99cn 2004-12-02
  • 打赏
  • 举报
回复
我的测试代码:main.php
<?php
//include "comm/smarty.class.php";
require ('./comm/Smarty.class.php');
define ('_SITE_ROOT','E:/smarty');
$tp1=new smarty();
$tp1->template_dir=_SITE_ROOT."./templates/";
$tp1->templates_c=_SITE_ROOT."./templates_c/";
$tp1->config_dir=_SITE_ROOT."./configs/";
$tp1->cache_dir=_SITE_ROOT."./cache/";
$tp1->left_delimiter="{/";
$tp1->right_delimiter="/}";
?>
test.htm
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<BODY>
<{$title}>
<br>
<{$content}>;
</BODY>
</HTML>
test.php
<?php
include "main.php";
$tp1->assign("title","测试用的网页");
$tp1->assign("content","测试用的网页内容");
$tp1->display("test.htm");
?>
各位大哥看看呀!
chf99cn 2004-12-02
  • 打赏
  • 举报
回复
有呀,都存在呀???
死胖子 2004-12-01
  • 打赏
  • 举报
回复
嗯,,看看你的模板路径有没有设置错误
$tpl->template_dir=__TEMPLATES_PATH;

,或确定你的TEST.HTM是否存在
wxq4100798 2004-12-01
  • 打赏
  • 举报
回复

呵呵,什么原因不好解说
1:确认你test.htm存在

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧