I am using codeigniter and handing admin side and users side separately. now i have model which is in admin folder and i want to call in controller of users. but when i am trying to load model from admin folder
$this->load->model('admin/myinterest_model');
$data['myInterest'] = $this->myinterest_model->selectResult('user', $this->session->userdata['Id']);
it shows following error
Message: Undefined property: Users::$myinterest_model
Filename: controllers/users.php
Please guide me how to load model from admin
$this->load->model('admin/myinterest_model' , 'myinterest');
The second parameter (optional) is used to call the method.
ex:
$this->myinterest->get_users();
try this call constructor in controller and load model into it
function __construct()
{
// Initialization of class
parent::__construct();
// load the model
$this->load->model('admin/myinterest_model');
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With