2018-06-05 14:58:52 1398次浏览 1条回答 0 悬赏 10 金钱

追踪源码到这里 发现了一个疑问的地方

public function __construct($config = [])
{
    Yii::$app = $this;

    static::setInstance($this);

    $this->state = self::STATE_BEGIN;

    $this->preInit($config);

    $this->registerErrorHandler($config);

    Component::__construct($config); //这里出现了疑问 

}

//以下是找出来的__construct方法

public function __construct($config = [])
{
    var_dump($config);die();
    if (!empty($config)) {
        Yii::configure($this, $config);
    }
    $this->init();
}

问题1 首先 这里非静态 ,
问题2 断点调试 时候发现$config 为空 ? 怎么会为空呢 哪个大神能帮我解决下疑问 感激不尽

补充于 2018-06-05 16:47

没人吗会打吗 0.0

您需要登录后才可以回答。登录 | 立即注册
凉凉的晴冷天
助理

凉凉的晴冷天

注册时间:2018-05-10
最后登录:2019-07-13
在线时长:6小时20分
  • 粉丝2
  • 金钱135
  • 威望0
  • 积分195

热门问题