phplib如何包括文件

freescy2002 freescy2002 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
以前html和php混编的时候使用include就可以包括一个文件 ,现在使用phplib后,php跟html分离后,将html放在单独的文件夹内,然后

$top=require("Template/top.htm");
include "Template/template.inc";
$t = new Template();
$t->set_file("MyFileHandle","Template/reg.htm");
$t->set_var("top",$top);
$t->parse("MyOutput","MyFileHandle");
$t->p("MyOutput");

在reg.htm
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
{top}
<body>
</body>
</html>

不会显示那个top.htm.为什么,谢谢了。
...全文

相关推荐

评论 7
收藏 已收藏
分享
返回顶部
freescy2002
基础编程 21,889 成员 140,329 内容