0
I am trying to make a Model work, it works on MAC with MAMP PRO, but in Ubuntu with Apache2 it does not work.
models/users_model.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
Class Users_model extends CI_Model {
function __construct() {
parent::__construct();
}
controllers/verifylogin.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class VerifyLogin extends CI_Controller {
function __construct() {
parent::__construct();
$this->load->model('users_model', '', TRUE);
}
By logging in to cms.local/admin/login it redirects to admin/verifylogin
On this screen he fires that error:
An Error Was Encountered
Unable to locate the model you have specified: Users_model
Codeigniter 3
The other models carry right?
– rray
Solved, in Codeigniter 3 the files have to be in "capitalize" mode, e.g.: Verifylogin.php, models/Users_model.php
– Raank
@rray no model carried, because it was lowercase the files.
– Raank
Put this as an answer, if you find the link to the documentation that says this is better.
– rray
Yes, I could even post the answer, but the error is not in Codeigniter, yes in Ubuntu, because on Mac with MAMP Pro works. How strange.
– Raank
But the class name is not different from the file? documentation link
– rray
No, it wasn’t, but on the Mac I used to _model quiet, just models/users.php and the class as Users in verifylogin.php, I will report this bug, I will also compare the PHP versions of the two.
– Raank