if("./" == $this->path) return $str;
$str = preg_replace("|".$this->path."|", $this->root."/".$this->path, $str);
return $str;
}
/**********************/
/* public: halt(string $msg)
* msg: error message to show.
*/
function halt($msg) {
$this->last_error = $msg;
if ($this->halt_on_error != "no")
$this->haltmsg($msg);
if ($this->halt_on_error == "yes")
die("<b>Halted.</b>");
return false;
}
/* public, override: haltmsg($msg)
* msg: error message to show.
*/
function haltmsg($msg) {
printf("<b>Template Error:</b> %s<br>\n", $msg);
}
}
?>
<?
//这个声明表明moban目录和img目录在同一级目录下
$t = new Template("moban", "../img");
//这个表明img目录在moban目录里
$t = new Template("moban", "img");
?>
| 对此文章发表了评论 |
