在windows下用到模板,class.FastTemplate.php

liuchanghu 2002-03-15 02:57:55
听说还要进行一些配置,在哪里?php.ini,class.fastTemplate.php3 ?
<?php
//5-1.php ,5-1.tpl
include("class.fastTemplate.php3");
$tp1=new FastTemplate(".");
$tpl->define(array(main=>'5-1.tpl'));//这里为什么总是报错
$tpl->assign(title,"hello!");
$tpl->parse(Body,"main");
$tpl->FastPrint("body");
?>

...全文
41 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
bombshell 2002-03-16
  • 打赏
  • 举报
回复
安装phplib7.2 ,它需要配置。
qsnake 2002-03-16
  • 打赏
  • 举报
回复
推荐使用phplib的模板,比fasttemplate快
zh_yuandc 2002-03-15
  • 打赏
  • 举报
回复
不用配置。
下面是我用快速模板写的新闻发布程序中一小段:
<?
include_once('../include/class.FastTemplate.php');
$tpl = new FastTemplate("./modules");
$tpl->define(array( main => "mainindex.tpl",
head => "head.tpl",
top => "top.tpl",
left => "left.tpl",
center => "center.tpl",
bottom => "bottom.tpl"));
$tpl->assign(TITLE,"");
$tpl->assign(SITE_NAME, "新闻首页");
……
$tpl->parse(common_top, top);
$tpl->parse(common_head,head);
$tpl->parse(common_left,left);

$tpl->parse(common_bottom,bottom);
$tpl->parse(MAIN,main);
$tpl->FastPrint("MAIN");
exit();
?>

21,891

社区成员

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

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