After Hosting Php codeignitor website I Got a Error "Unable to locate the model you have specified: Common_model" But Its Works in my local server How I can solve this issue I already change First letter of the model class name capitalized but no result my model class
class Common_model extends CI_Model
{
}
and controller is
<?php
class Show extends CI_Controller
{ var $pageLimit = 6;
public function __construct()
{
parent::__construct();
$this->load->library('ion_auth');
$this->load->model('common/Common_model');
$this->load->helper('url');
$this->load->helper('form');
$this->load->helper('custom');
}
}
If you are are using Codeignitor 3 than make sure you file name also start with capital letter as:
Common_model.php
It's recommended to use your models
inside the model folder not model/anyfolder
I hope Your model file structure is like
application
model
common
Common_model.php
File name should be Common_model.php
.
Load in Controller should be
$this->load->model('common_model');
I always load it with the name only, this way
$this->load->model('Common_model');
Always the controller is on the same module (if you are using modules)