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?
controller name , class name should same , file name in lower case
funding.php
and try following url
model class name different controller name
funding_model
or else , no need suffix_model
in->load->model()
Comments
Post a Comment