Welcome Guest, Not a member yet? Register   Sign In
Fatal error: Class 'Model' not found After Upgrade to version 2.0
#1

[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
#2

[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
#3

[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
-----------------
#4

[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.
#5

[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 ?
#6

[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...
#7

[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?




Theme © iAndrew 2016 - Forum software by © MyBB