Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7748719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:51:24+00:00 2026-06-01T10:51:24+00:00

I’m new to MVC and Codeigniter and am trying to get a class working.

  • 0

I’m new to MVC and Codeigniter and am trying to get a class working.

I’m running CodeIgniter 2.1.0 and Doctrine 2.2.1

When my code calls the submit() function, I get Class 'Myclass_model' not found, and references to the line that includes: $u = new Myclass_model();

(See edit note at the bottom, now getting Class 'Doctrine_Record' not found in the model where it is extended)

In my controller is the following code:

public function submit() {

        if ($this->_submit_validate() === FALSE) {
            $this->index();
            return;    
        }

        $u = new Myclass_model();
        $u->username = $this->input->post('username');
        $u->password = $this->input->post('password');
        $u->email = $this->input->post('email');
        $u->save();

        $this->load->view('submit_success');
    }

And in my /application/models/ folder I have myclass.php:

class Myclass extends Doctrine_Record {

public function setTableDefinition() {
    $this->hasColumn('username', 'string', 255, array('unique' => 'true'));
    $this->hasColumn('password', 'string', 255);
    $this->hasColumn('email', 'string', 255, array('unique' => 'true'));
}

public function setUp() {
    $this->setTableName('testtable1');
    $this->actAs('Timestampable');
            //$this->hasMutator('password', '_encrypt_password');
}

    protected function _encrypt_password($value) {
         $salt = '#*seCrEt!@-*%';
         $this->_set('password', md5($salt . $value));
         //Note: For mutators to work, auto_accessor_override option needs to be enabled. We have already done it, in our plugin file doctrine_pi.php.

    }
}

I suspect that my problem is with extending Doctrine_Record. I have doctrine2 installed, and in /application/libraries/ I have Doctrine.php and the Doctrine folder. But I’m not sure where to check, or even how to check and make sure that Doctrine_Record is available, configured, etc.

Can anyone help me troubleshoot this and figure out where the problem lies? Something simple with my class? Some problem with my Doctrine install/config?

Edit: I followed the suggestion of calling the class like so:

$this->load->model('Myclass_model','u');

And am now getting Class 'Doctrine_Record' not found where the model extends Doctrine_Record

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T10:51:25+00:00Added an answer on June 1, 2026 at 10:51 am

    I suspect you didn’t include your Myclass.php file or have an incorrect path. If you were having issues with the Doctrine extension, your error would mention the parent. Even still, make sure you include the parent file inside your new class with a include_once('path/to/doctrine_record');

    You can add it to the autoload.php file or manually like so :

    public function submit() {
    
            if ($this->_submit_validate() === FALSE) {
                $this->index();
                return;    
            }
    
            include_once('/path/to/Myclass.php');
            $u = new Myclass();
            $u->username = $this->input->post('username');
            $u->password = $this->input->post('password');
            $u->email = $this->input->post('email');
            $u->save();
    
            $this->load->view('submit_success');
        }
    

    Or even better, you load it like a model. Rename the file to myclass_model.php and the class name to Myclass_model 🙂

    public function submit() {
    
            if ($this->_submit_validate() === FALSE) {
                $this->index();
                return;    
            }
    
            $this->load->model('Myclass_model','u');
            $this->u->username = $this->input->post('username');
            $this->u->password = $this->input->post('password');
            $this->u->email = $this->input->post('email');
            $this->u->save();
    
            $this->load->view('submit_success');
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I want use html5's new tag to play a wav file (currently only supported
I am doing a simple coin flipping experiment for class that involves flipping a
I am trying to render a haml file in a javascript response like so:
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.