/*********************************/
/* public: Constructor.
* root: template directory.
* unknowns: how to handle unknown variables.
*/
function Template($root = ".", $path = ".", $unknowns = "remove") {
$this->set_root($root);
$this->set_path($path);
$this->set_unknowns($unknowns);
}
/* 设置图片路径
*/
function set_path($path){
if($path == ".") return true;
if (!is_dir($this->root . "/" . $path)) {
$this->halt("set_path: $path is not a directory.");
return false;
}
$this->path = $path;
return true;
}
/* public: setroot(pathname $root)
* root: new template directory.
*/
function set_root($root) {
if (!is_dir($root)) {
$this->halt("set_root: $root is not a directory.");
return false;
}
$this->root = $root;
return true;
}
/* public
| 对此文章发表了评论 |
