compile_dir="./com/";但"/> compile_dir="./com/";但">
Home > Backend Development > PHP Tutorial > 让人疑惑的私有属性

让人疑惑的私有属性

WBOY
Release: 2016-06-13 12:21:52
Original
835 people have browsed it

让人不解的私有属性

本帖最后由 tp_2015_6 于 2015-06-12 08:44:46 编辑 因为用smarty,并且重新定义缓存文件夹和模板文件夹,所以在入口文件中写了这个:
$tpl->template_dir="./tpl/";
$tpl->compile_dir="./com/";

但是smarty.class.php中,这两个属性是私有的,如
 private $template_dir = array('./templates/');
/**
     * compile directory
     *
     * @var string
     */
    private $compile_dir = './templates_c/';
   



按说即然是私有属性,在入口文件中再重新赋值是不允许的,可是离奇的事发生了,却偏偏允许,难道这里还有别的机关不成

------解决思路----------------------
看看类里面是否使用了 魔术方法__set之类的呢.
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template