codeigniter - Codeignite 404 error -


i ham writing follow codeigniter code, keep getting 404 error. thoughts?

funding_controller.php

class funding extends ci_controller {      function __construct()     {         // call model constructor         parent::__construct();      }       public function index()     {          $this->load->model('funding_model');          $data['funds'] = $this->funding_model->getall();         $this->load->view('funding_list', $data);     } } 

funding_model.php

  class funding extends ci_model {      function __construct()     {         // call model constructor         parent::__construct();     }      function getall() {          $query = $this->db->get('funds');          return $query->result();      }   }     

funding_list.php

foreach($funds $row) {     echo $row->opportunity_name;    echo "<br />";  } 

the default route points funding_controller. thoughts?

  1. controller name , class name should same , file name in lower case

    funding.php

    and try following url

    http://domain.com/funding/index

  2. model class name different controller name funding_model or else , no need suffix _model in ->load->model()


Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -