CodeIgniter Forums

Full Version: CI and Doctrine: Class 'User' not Found Error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum


FOUND ERROR: I forgot to autoload doctrine in system\application\config\autoload.php

I keep getting this error message:
Quote:Fatal error: Class 'User' not found in C:\xampp\htdocs\ci_doctrine_day1\system\application\controllers\hello.php on line 17

when testing out this code:

// system/application/controllers/hello.php

class Hello extends Controller {

    function world() {
        echo "Hello CodeIgniter!";

    function user_test() {

        $u = new User;  //****************Line 17**********************
        $u->username = 'johndoe';
        $u->password = 'secret';
        $u->first_name = 'John';
        $u->last_name = 'Doe';

        $u2 = new User;
        $u2->username = 'phprocks';
        $u2->password = 'mypass';
        $u2->first_name = 'Codeigniter';
        $u2->last_name = 'Doctrine';

        echo "added 2 users";


// system/application/models/user.php
class User extends Doctrine_Record {

    public function setTableDefinition() {
        $this->hasColumn('username', 'string', 255);
        $this->hasColumn('password', 'string', 255);
        $this->hasColumn('first_name', 'string', 255);
        $this->hasColumn('last_name', 'string', 255);


while following this tutorial:


Any ideas why I am getting this error message?

El Forum

I have exactly the same... :-(
I dont suppose you fixed this issue???