• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using class in model

#2
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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.