Confusing private attributes-php Tutorial

Source: Internet
Author: User
Confusing private attributes this post was last edited by tp_2015_6 at 2015-06-1208:44:46. because smarty is used and the cache folder and template folder are redefined, this post is written in the portal file: $ tpl-& gt; template_dir.tpl; $ tpl-& gt; compile_dir.com; but confusing private attributes

This post was last edited by tp_2015_6 at 08:44:46

Because smarty is used and the cache folder and template folder are redefined, this is written in the entry file:
$ Tpl-> template_dir = "./tpl /";
$ Tpl-> compile_dir = "./com /";

However, in smarty. class. php, these two attributes are private, such
Private $ template_dir = array ('./templates /');
/**
* Compile directory
*
* @ Var string
*/
Private $ compile_dir = './templates_c /';




It is actually a private property. it is not allowed to assign a value again in the entry file. However, a strange thing happened, but it was allowed. isn't there any other authority here?

------ Solution ----------------------
Check whether the magic method _ set is used in the class.

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.