这是模板文件
<?php
class Tpl
{
//模版文件的路径
protected $viewDir='./view/';
//生成缓存文件的路径
protected $cacheDir='./cache/';
//过期时间
protected $lifeTime=3600;
//用来存放显示变量的数组
protected $vars=array();
//构造方法对成员变量进行初始化
function __construct($viewDir=null,$cacheDir=null,$lifeTiem=null)
{
if(!empty($viewDir))
{
if($this->checkDir($viewDir))
{
$this->viewDir=$viewDir;
}
}
if(!empty($cacheDir))
{
if($this->checkDir($cacheDir))
{
$this->cacheDir=$cacheDir;
}
}
if(!empty($lifeTiem))
{
$this->lifeTiem=$lifeTiem;
}
}
//判断目录路径是否为路径或文件夹
protected function checkDir($dirPath)
{
if(!file_exists($dirPath) || !is_dir($dirPath))
{
return

最低0.47元/天 解锁文章
329

被折叠的 条评论
为什么被折叠?



