0
class model_demo extends CI_Model{
function model_demo()
  {
    parent::Model();
  }
}

I'm working with CodeIgniter with a constructor, and it's producing a fatal error.

1
  • You need to research more. Try to look in the CodeIgniter manual first. Commented May 6, 2013 at 12:33

2 Answers 2

2
class model_demo extends CI_Model{
function model_demo()
{ 
   parent::__construct();
}
Sign up to request clarification or add additional context in comments.

Comments

1

If you are using Codeigniter 2 or abore, try:

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

You can see the syntax here:

Models: Codeigniter User guide

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.