getHtml(
$fileName
);
die
(
$this
->html);
}
public
function
fetch(
$fileName
){
$this
->getHtml(
$fileName
);
return
$this
->html;
}
public
function
loadFilter(
$filterName
){
$this
->filters[] =
$filterName
;
}
private
function
getHtml(
$fileName
){
if
(!
file_exists
(
$fileName
)){
self::toError(
basename
(
$fileName
).'文件不存在。');
}
ob_start();
include
(
$fileName
);
$this
->html = ob_get_clean();
}
private
static
function
toError(
$error
){
header('HTTP/1.0 500 Internal Server Error');
die
('Internal Server ErrorPHPTemplate: '.
$error
.'');
}
}