Please help me to see what this is-php Tutorial

Source: Internet
Author: User
Please help me to see what error classes are automatically loaded. other classes can be automatically loaded. that is, the tpl class cannot automatically load Fatalerror: ClassTplnotfoundinD: AppServwwwyshopconfigsrun. inc. phponline22 I manually requireROOT_PATH.publicTpl.class.php; I also asked you to help me see what the error is.
Other classes can be automatically loaded, that is, the tpl class cannot be automatically loaded.
Fatal error: Class 'tpl 'not found in D: \ AppServ \ www \ yshop \ configs \ run. inc. php on line 22

This error is returned when I manually 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

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 directory
$ This-> template_dir = ROOT_PATH. '/view /';
// Compile the Directory
$ This-> compile_dir = ROOT_PATH. '/compile /';
// Configure the variable Directory
$ This-> config_dir = ROOT_PATH. '/configs /';
// Cache Directory
$ This-> cache_dir = ROOT_PATH. '/cache /';
// Whether to enable the cache. in the website development and debugging stage, we should disable the cache.
$ This-> caching = 0;
// Cache declaration period
$ This-> cache_lifetime = 60*60*24;
// Left delimiter
$ This-> left_delimiter = '{';
// The right separator
$ This-> right_delimiter = '}';
}
} There are 46 rows.

?>

------ Solution --------------------
That is because the access permission of your Smarty class constructor (_ construct) is public. according to the oo rule, the access permission of the same method that the subclass rewrites must be lower than that of the parent class, the so-called high-low relationship is (private> protected> public)

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.