CodeIgniter Forums
Model Error - 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: Model Error (/showthread.php?tid=6129)



Model Error - El Forum - 02-15-2008

[eluser]jigen7[/eluser]
hi i just keep getting this error when loading a model
when i tried to load it in the controller
Code:
$this->load->model('Reservation_model');
it give me an error
Code:
class Reservation_model extends Model { }
Fatal error: Class 'Reservation_model' not found in E:\wwwroot\htdocs\jigen\sirjeric\system\libraries\Loader.php on line 177

heres the model code
Code:
class Reservation_model extends Model {

    function Reservation_model()
    {
        parent::Model();
    }
}
thx


Model Error - El Forum - 02-15-2008

[eluser]Bryan Zera[/eluser]
What is the file name of the Model code?

The filename needs to be all lowercase, even if the model's name starts with an uppercase letter.


Model Error - El Forum - 02-15-2008

[eluser]tonanbarbarian[/eluser]
and the filename need to be the full class name
so it must be reservation_model.php and it must appear in the models folder, no sub folder


Model Error - El Forum - 03-04-2008

[eluser]stathis[/eluser]
i'm having the exact problem.
I have a model class:
Code:
class Myclass extends Model {
    function Myclass()
    {
    // Call the Model constructor
    parent::Model();
    }

    function my_function()
    {
    }
}
that is saved as myclass.php
Once i try to load it using
Code:
$this->load->model('myclass');
i get the same error.
Any ideas??


Model Error - El Forum - 03-04-2008

[eluser]jigen7[/eluser]
well in my case i forgot to include the <?php and ?> at the beginning and ending of the script ^_^


Model Error - El Forum - 03-04-2008

[eluser]stathis[/eluser]
well, that was my problem too.. ^_^
Thanks for responding.