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

[eluser]Jim-Bingo[/eluser]
When I load my firstpage I get this message:

Quote:An Error Was Encountered

Unable to locate the model you have specified: startmodel

My controller start.php:
Code:
<?php
class Start extends Controller {
        
    function index()
    {
          $this->load->model('startmodel');
          $news['news'] = $this->startmodel->get_last_three_news();
          $data = array(
               'title' => 'Malungs OK SkogsmÃ¥rdarna',
               'content' => $this->load->view('content/start',$news,true)
          );
  
          $this->load->view('layout/main',$data);
    }
        
}
?>

My model Startmodel.php:

Code:
<?php
class Startmodel extends Model {

    function Startmodel()
    {
         parent::Model();
    }
    
    function get_last_three_news()
    {
        $query = $this->db->get('tbl_news', 3);
        return $query->result();
    }
    
}
?>

Anybody knows whats wrong?
#2

[eluser]gtech[/eluser]
hummph... I copied and pasted your code but it worked ok.. did you place the startmodel.php in the models directory?
#3

[eluser]Jim-Bingo[/eluser]
Yes I did...
#4

[eluser]vobla[/eluser]
Lowercase "Startmodel.php" filename..




Theme © iAndrew 2016 - Forum software by © MyBB