您好,欢迎访问一九零五行业门户网

请大家帮小弟我看下这是什么东东

请大家帮我看下这是什么错误
类的自动加载别的类都可以自动加载就是tpl类不能自动加载
fatal error: class 'tpl' not found in d:\appserv\www\yshop\configs\run.inc.php on line 22
我手动 require root_path.'/public/tpl.class.php';又出现这个错误
fatal error: access level to tpl::__construct() must be public (as in class smarty) in d:\appserv\www\yshop\public\tpl.class.php on line 46
setconfigs();
}
private function setconfigs(){
//模板目录
$this->template_dir = root_path.'/view/';
//编译目录
$this->compile_dir = root_path.'/compile/';
//配置变量目录
$this->config_dir = root_path.'/configs/';
//缓存目录
$this->cache_dir = root_path.'/cache/';
//是否开启缓存,网站开发调试阶段,我们应该关闭缓存
$this->caching = 0;
//缓存的声明周期
$this->cache_lifetime = 60*60*24;
//左定界符
$this->left_delimiter = '{';
//右定界符
$this->right_delimiter = '}';
}
} 这里是46行
?>
------解决方案--------------------
那就是因为你的smarty类的构造函数(__construct)访问权限是public,根据oo规则,子类复写的同一方法,访问权限必须低于父类的,所谓的高低关系为(private > protected > public)
其它类似信息

推荐信息