Welcome Guest, Not a member yet? Register   Sign In
Model not found
#1

[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




Theme © iAndrew 2016 - Forum software by © MyBB