用户
 找回密码
 入住 CI 中国社区
搜索
查看: 1690|回复: 3
收起左侧

[内核] $this->load

[复制链接]
发表于 2018-3-12 18:17:52 | 显示全部楼层 |阅读模式
想问一下 $this->load 是返回什么?在源代码那里可以查看,谢谢!
发表于 2018-3-12 18:59:08 | 显示全部楼层
这个返回的是 loader 实例。
 楼主| 发表于 2018-3-13 10:06:21 | 显示全部楼层
class CI_Controller {

        /**
         * Reference to the CI singleton
         *
         * @var        object
         */
        private static $instance;

        /**
         * Class constructor
         *
         * @return        void
         */
        public function __construct()
        {
                self:instance =& $this;

                // Assign all the class objects that were instantiated by the
                // bootstrap file (CodeIgniter.php) to local class variables
                // so that CI can run as one big super object.
                foreach (is_loaded() as $var => $class)
                {
                        $this->$var =& load_class($class);
                }

                $this->load =& load_class('Loader', 'core');
                $this->load->initialize();
                log_message('info', 'Controller Class Initialized');
        }

。。。。  是这段代码吧。

本版积分规则