<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter Model Class
*/
class CI_Model {
/**
* Constructor
*/
function __construct()
{
log_message('debug', "Model Class Initialized");
}
/**
* __get
* Model类的代码也非常少,有用的方法就下面这一个,下面这个方法是为了在Model里面可以像控制器那么通过$this->
* 做很多事情。例如想在model里面加载某个library,就可以$this->load->library(xxx),其实它都是盗用controller的。
*/
function __get($key)
{
$CI =& get_instance();
return $CI->$key;
}
}
CodeIgniter源码分析之Model.php
最新推荐文章于 2021-04-09 09:12:55 发布