Please help me to see what this is wrong
Automatic loading of classes other classes can be automatically loaded is the TPL class does not automatically load
Fatal error:class ' Tpl ' not found in D:\AppServ\www\yshop\configs\run.inc.php on line 22
I manually require Root_path. ' /public/tpl.class.php '; This error has occurred again
Fatal error:access level to tpl::__construct () must is public (as-class Smarty) in D:\AppServ\www\yshop\public\Tpl.cla Ss.php on line 46
Class TPL extends smarty{
static private $instance;
static public Function getinstance () {
if (! ( Self:: $instance instanceof Self)) {
Self:: $instance = new self ();
}
Return self:: $instance;
}
Private Function __clone () {
}
Private Function __construct () {
$this->setconfigs ();
}
Private Function Setconfigs () {
Template Catalog
$this->template_dir = Root_path. ' /view/';
Compiling the Directory
$this->compile_dir = Root_path. ' /compile/';
Configure variable Directory
$this->config_dir = Root_path. ' /configs/';
Cache Directory
$this->cache_dir = Root_path. ' /cache/';
Whether to turn caching on, site development debugging phase, we should close the cache
$this->caching = 0;
The cache's declaration period
$this->cache_lifetime = 60*60*24;
Left delimiter
$this->left_delimiter = ' {';
Right delimiter
$this->right_delimiter = '} ';
}
This is 46 rows.
?>
------Solution--------------------
That's because your Smarty class's constructor (__construct) access is public, according to OO rules, the same method of subclass replication, access permissions must be lower than the parent class, the so-called high-low relationship is (Private > Protected > Public
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service