Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter 2.0 - Class 'Model' not found
#1

[eluser]Quaotloa[/eluser]
Hi, I try to do something very simple, but can't get it to work..
I downloaded the latest rev of CI from bitbucket.

Created one model, and one controller..

When i try to run, I get this error:

Fatal error: Class 'Model' not found in /Applications/MAMP/htdocs/application/models/customer.php on line 3


In rev 1.7.2, this would work.. But is there something I have forgotten to do, or what..?


Regards.
#2

[eluser]Jelmer[/eluser]
Try reading Phil Sturgeon's upgrade to CI2.0 guide on his blog.

Bottom line: Model has been renamed to CI_Model and you should change "extends Model" to "extends CI_Model".
#3

[eluser]Unknown[/eluser]
Make the following changes in your model to make it work in Codeigniter 2.0.

Change

class Category_model extends Model {
....................
}

TO

class Category_model extends CI_Model {
....................
}



---------------------

Also Change

function _construct()
{
// Call the Model constructor
parent::Model();
}

TO

function _construct()
{
// Call the Model constructor
parent::_construct();
}

Hope this helps ...




Theme © iAndrew 2016 - Forum software by © MyBB