Therefore, whenever you extend a class CI_Model, your models inherit functions __constructand __get, both of which are Magic methods ,
A function __constructwill be called whenever you call a function in your model. All he does is just create a log message.
function __construct()
{
log_message('debug', "Model Class Initialized");
}
, , , - .
$this->load->model('Model_name');
$this->Model_name->function();
, , , - .
__get
.
, CI . , - $this->session->userdata('username'). __get CI_Model, , . , CI_Model, . , ,
source
share