CodeIgniter Forums
Fatal error: Class 'Model' not found After Upgrade to version 2.0 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Fatal error: Class 'Model' not found After Upgrade to version 2.0 (/showthread.php?tid=34787)



Fatal error: Class 'Model' not found After Upgrade to version 2.0 - El Forum - 10-09-2010

[eluser]Ali Fattahi[/eluser]
Hi Everybody
i have upgraded from v1.7.2 to 2.0 but i got an error in my project
how can i solve this problem ?

error :
Fatal error: Class 'Model' not found in C:\xampp\htdocs\Saba_CI2\application\models\userModel.php on line 2


Best Regards
Ali


Fatal error: Class 'Model' not found After Upgrade to version 2.0 - El Forum - 10-09-2010

[eluser]Bainzy[/eluser]
change the model declaration to the following :

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

in codeigniter 2 we have to extend CI_Model rather than Model


Fatal error: Class 'Model' not found After Upgrade to version 2.0 - El Forum - 10-09-2010

[eluser]Ali Fattahi[/eluser]
Thanks a lot
after solving this problem i have another problem
i got 3 errors :

A PHP Error was encountered

Severity: Warning

Message: Illegal offset type in isset or empty

Filename: core/Loader.php

Line Number: 81

A PHP Error was encountered


Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\SabaPay_CI2\system\core\Exceptions.php:171)

Filename: core/Common.php

Line Number: 428
-----------------
An Error Was Encountered

Unable to load the requested class: validation
-----------------


Fatal error: Class 'Model' not found After Upgrade to version 2.0 - El Forum - 10-09-2010

[eluser]WanWizard[/eluser]
The first error is from trying to load a library the wrong way, so check your controller.
The second is because of the first.

The validation library is deprecated since 1.7.0, and should not have been used anymore in 1.7.2. It is removed as of 2.0, you should now use the form_validation library.


Fatal error: Class 'Model' not found After Upgrade to version 2.0 - El Forum - 10-09-2010

[eluser]Ali Fattahi[/eluser]
I Checked All Libraries in Controllers
All of Libraries is correct and working good in 1.7.2 but in v2.0 shows that errors Sad
is any other way to solve this problem ?


Fatal error: Class 'Model' not found After Upgrade to version 2.0 - El Forum - 10-09-2010

[eluser]WanWizard[/eluser]
All I can deduct from the little info you share is that $this->load->library() fails. Since I don't have access to your code, the rest is guess work...


Fatal error: Class 'Model' not found After Upgrade to version 2.0 - El Forum - 10-09-2010

[eluser]Ali Fattahi[/eluser]
i found that problem is for "form_validation" name ! and CodeIgniter 2.0 can't load this library with "form_validation" Name!
can you please help me more about this problem?