Welcome Guest, Not a member yet? Register   Sign In
Using class in model
#2

(This post was last modified: 04-21-2017, 03:35 AM by neuron.)

As I know $this  in library does not reference to CI, it references library class itself.


Thus in your code
$this->load within library

you need to get instance of CI
so instead of:

Code:
 $this->load->model('users_model');
try:

Quote:
PHP Code:
$CI =& get_instance();
$CI->load->model('user_model');

$CI->users_model->login_remembered_user(); 
Reply


Messages In This Thread
Using class in model - by -V1cu- - 04-21-2017, 03:19 AM
RE: Using class in model - by neuron - 04-21-2017, 03:34 AM
RE: Using class in model - by -V1cu- - 04-21-2017, 03:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB