Model error |
Hi, recently I start seeing Model error in logs. It happens rarely but I wanted to know reason.
Error saying: ERROR - 2018-02-05 13:57:26 --> Severity: error –> Exception: /public_html/application/models/Car_model.php exists, but doesn't declare class Car_model /public_html/system/core/Loader.php 336 My Car_model.php: PHP Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); What might cousing this error?
Are you just loading the Model in a controller or are you auto loading it?
If it's in a controller try loading it in the controllers __constructor. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
You're saying this happens intermittently? In other words, sometimes the class loads, but sometimes it won't?
I am loading it in MY_Controller.
yes Dave it happens intermittently PHP Code: class MY_Controller extends CI_Controller {
If your going to load it in the MY_Controller you might as well autoload them.
I would load them in the Controllers that use them. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |