Welcome Guest, Not a member yet? Register   Sign In
Unable to locate model
#1

[eluser]herbageonion[/eluser]
Hi, I'm getting the following error when I try to run my news page. Its not a case issue, as I have everything as the user guide says.

I'm really stuck, can anyone help me?

Code:
An Error Was Encountered

Unable to locate the model you have specified: news_model

Code:
class News extends Controller
{
    function News()
    {
        parent::Controller();

        // Load Helpers
        $this->load->helper( array('url', 'date', 'text', 'form') );
        // Load Libraries
        $this->load->library( array('session', 'validation', 'pagination') );
        // Load Models
        $this->load->model('news_model');
        
        if ($this->session->userdata('logged_in') != true )
        {
            redirect('login', 'location');
        }
    }

    function index()
    {
    }
}

Code:
class News_model extends Model {

    function News_model()
    {
        parent::Model();
    }

    function get_news($num = 0, $offset = 0)
    {
        $num    = (isset($num)) ? $num : 0;
        $offset    = (isset($offset)) ? ', '.$offset : ', 0';
        $query = $this->db->query("SELECT * FROM `cms_news` ORDER BY news_date DESC LIMIT $num, $offset");
        return $query;
    }
}


Messages In This Thread
Unable to locate model - by El Forum - 09-20-2007, 06:14 AM
Unable to locate model - by El Forum - 09-20-2007, 06:26 AM
Unable to locate model - by El Forum - 09-20-2007, 06:30 AM
Unable to locate model - by El Forum - 09-20-2007, 06:40 AM
Unable to locate model - by El Forum - 09-20-2007, 06:47 AM
Unable to locate model - by El Forum - 09-20-2007, 07:23 AM



Theme © iAndrew 2016 - Forum software by © MyBB