Welcome Guest, Not a member yet? Register   Sign In
Model Error
#1

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

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

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

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

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

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




Theme © iAndrew 2016 - Forum software by © MyBB