I'm getting this error:
Unable to locate the model you have specified: Users_model
CodeIgniter is version 3. The filename is Users_model.php
. It is located at application\models
and it goes like this:
defined('BASEPATH') OR exit('No direct script access allowed');
class Users_model extends CI_Model {
public function __construct()
{
parent::__construct();
}
[...]
}
I am calling it from a controller like this:
$this->load->model('users_model');
Interestingly enough, it works on a local mongoose server, but not when I deploy it to a heroku server.
Your git may be configured to ignore case changes in file names. The effect of this is: any local changes to a filename of a file that has already been deployed (i.e. is only being modified) are not mirrored on the remote repository (heroku).
For example, if you first deployed a file with the name users_model.php
all lowercase. Even if you change the local version of the file to Users_model.php
with the 'U' capitalized, the remote won't mirror this change.
How to solve it: to tell git to update filename case changes, run the following command:
git config core.ignorecase false
Thanks to @Kamram for making me figure this out and @FeanDoe for suggesting that I answer the question.
Try this.
users_model.php
.inside model it should be (Users_Model)
class Users_Model extends CI_Model{}
.
When you calling use $this->load->model('Users_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