Answer the question
In order to leave comments, you need to log in
How to load models in rest full codeginiter?
Actually a subject. How to load several models in codeigniter when using a well-known library to create a rest full api. Library - https://github.com/chriskacerguis/codeigniter-rest...
The problem is that when loading the second model in the constructor (yes, anywhere in the controller), codeigniter does not see the second model.
function __construct()
{
parent::__construct();
$this->load->model('api/v1/users_model');
$this->load->model('api/v1/auth_model');
date_default_timezone_set('Europe/Moscow');
$type_data = "%Y-%m-%d";
$time = time();
$this->date = mdate($type_data, $time);
}
<p>Severity: Notice</p>
<p>Message: Undefined property: Users::$auth_model</p>
<p>Filename: v1/users.php</p>
<p>Line Number: 73</p>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question