index继承parent::__construct()无效???

浏览:3025 发布日期:2016/06/22 分类:ThinkPHP5专区
controller文件下3个文件
Common.php
Page.php
Index.php

Common.phpclass Common extends Controller{
    public $conf;

    function __construct(){
        $this->conf=getSet();
        $this->assign('conf',$this->conf);

    }
}
Page.phpclass Page extends Common
{

    function __construct()
    {
        parent::__construct();
    }
Index.phpclass Index extends Common
{
    function __construct()
    {
        parent::__construct();
    }
在page里面可以打印$conf
但在index里面确没法打印 $conf 了...
最佳答案
评论( 相关
后面还有条评论,点击查看>>