CodeIgniter Forums
Model not found - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Model not found (/showthread.php?tid=47870)



Model not found - El Forum - 12-26-2011

[eluser]Unknown[/eluser]
Hi. I've been starting with CI recently and ran into an issue where I need help. I tried to find the issue using the forum search, but didn't get anything that matched.

I just installed CI, site is running, PHP version is right, I can modify a controller, all good. Now I tried to set up a model. in models/ I have a file named "data.php" and a nearly empty model file just for testing:

Code:
class Data extends CI_Model {
    function __construct()
    {
        parent::__construct();
    }
}

In the welcome controller I try to load the model like this, straight from the docs:

Code:
public function index()
        {
                $this->load->model('Data');
                $this->load->view('welcome_message');
        }

Whatever I do, however I name the data class, I get this error:

class Data extends CI_Model { function __construct() { parent::__construct(); } }
Fatal error: Class 'Data' not found in /var/www/<website name removed>/www/system/core/Loader.php on line 303

Any hint on this?

Thanks!
Martin