Welcome Guest, Not a member yet? Register   Sign In
problem with loading a Model
#1

[eluser]S1NTEZ[/eluser]
Codeigniter 2.0
i try to load a Model
Code:
$this->load->model('Site_elements_model');

simple model site_elements_model.php:
Code:
<?php
    class Site_elements_model extends Model {

    function Site_elements_model()      
    {
        parent::Model();
    }
    
    function get_last_ten_entries()
    {
        return 'yess';
    }

}

and get the error:
Quote:Fatal error: Class 'Model' not found in C:\www\test\application\models\site_elements_model.php on line 2

what am I doing wrong?
#2

[eluser]WanWizard[/eluser]
The Model library is loaded by the Loader library the first time you use $this->load->model().

It doesn't check if the library can be loaded, so I assume that's the issue here. Check if you have the file ./system/libraries/Model.php (with a capital M), and if your webserver has sufficient rights to read it.
#3

[eluser]S1NTEZ[/eluser]
work if the write CI_Model

http://bitbucket.org/ellislab/codeigniter/src/tip/system/core/




Theme © iAndrew 2016 - Forum software by © MyBB