|
楼主 |
发表于 2016-5-4 10:50:35
|
显示全部楼层
我找到答案了,在model的父类CI_model 中有这么一个函数:
public function __get($key)
{
// Debugging note:
// If you're here because you're getting an error message
// saying 'Undefined Property: system/core/Model.php', it's
// most likely a typo in your model code.
return get_instance()->$key;
}这个函数上面有一段注释:* __get magic
*
* Allows models to access CI's loaded classes using the same
* syntax as controllers.是说允许models的对象使用CI的已经加载的类,$this->load 实际上调用的是get_instance()->load,即获取的是CI->load
|
|