唠叨过来看下,smarttemplate问题
昨天测试通过了
可是有几点疑问:
1。下面程序标出来的三处为什么都要加上"./"符号才可以通过,不加就提示出错.为什么?
2。加上ini_set('include_path',realpath('./include'));这句话以后是不是所有用到require 'x.php';都是指require 'x盘符:/***/include/x.php';
<?
ini_set('include_path',realpath('./include'));
require_once "class.smarttemplate.php";
$_CONFIG = array(
smarttemplate_compiled => "./temp", //第一处
smarttemplate_cache => "./cache", //第二处
cache_lifetime => 600,
template_dir => "./templates/default" //第三处
);
$page = new SmartTemplate("uppercase.html");
$page->assign('TEXT', 'Simple Demo Text.');
$page->output();
?>
问题点数:10、回复次数:10Top
1 楼php_love(学习PHP,做个好人)回复于 2005-03-10 09:36:01 得分 0
看过来了Top
2 楼xuzuning(唠叨)回复于 2005-03-10 09:49:53 得分 10
1、与你的系统有关,不一定需要,写上较规范
2、是的Top
3 楼php_love(学习PHP,做个好人)回复于 2005-03-10 09:55:50 得分 0
谢谢Top
4 楼php_love(学习PHP,做个好人)回复于 2005-03-10 09:59:04 得分 0
再问下,我见过有的程序中会有这样的句子
DEFINE ('XX','D:/XXXXX/');
既然用ini_set已经把include的绝对路径确定下来了,这个DEFINE就没有必要用了吧?你用过DEFINE吗?如果用过,又通常在什么地方呢?Top
5 楼xuzuning(唠叨)回复于 2005-03-10 10:14:11 得分 0
不错,有人是喜欢自定义一些常量的
但是我不喜欢,我用全局变量。这样引用时书写方便点。
个人喜好吧
对于smarttemplate而言,这种定义是无效的,除非你修改他的代码。
smarttemplate::output中有
include_once ("class.smarttemplateparser.php");
smarttemplate::debug中有
include_once ("class.smarttemplatedebugger.php");
所用到的模板函数都会在编译后的文件里加上
include_once "smarttemplate_extensions/smarttemplate_extension_fuunctionname.php";
如果你不设定include_path而使用define的话,就要把那些地方改做
include_once (XXX."class.smarttemplateparser.php");
....Top
6 楼php_love(学习PHP,做个好人)回复于 2005-03-10 10:23:26 得分 0
呵呵,受教了,你真伟大
基本上已经看了一遍了,在此我要感谢你这么大公无私的帮助我
在下载的smarttemplate包中有个change.txt
内容如下:
我看不太懂,它说的是要修改哪些地方啊?
02.04.2003: Release 1.0.2 Philipp von Criegern <philipp@smartphp.net>
Fixed: Filename of compiled template replaces ':' and '\' to '_' to allow absoulte paths in
windows ('C:\apache\htdocs\tmeplates\hello_world.html') in class.smarttemplate.php (256)
Fixed: Global Content Array $_top is deleted after usage in order to allow multiple use of
SmartTemplate class in one script in class.smarttemplate.php (281)
Added: Trailing '/' added to $this->temp_dir in class.smarttemplate.php (240)
Top
7 楼xuzuning(唠叨)回复于 2005-03-10 10:36:25 得分 0
那是记录开发者何时做了何种修改的文件Top
8 楼php_love(学习PHP,做个好人)回复于 2005-03-10 10:38:26 得分 0
哦,都很伟大Top
9 楼edward0716(雲威龍)回复于 2005-03-10 11:07:34 得分 0
up learn.Top
10 楼php_love(学习PHP,做个好人)回复于 2005-03-10 11:13:27 得分 0
这个贴子不能结,奇怪了,斑竹给结掉吧Top




