Welcome Guest, Not a member yet? Register   Sign In
Not Finding My Model
#3

[eluser]hitraj47[/eluser]
Here is the code for controllers/page.php"

Code:
<?php

class Page extends CI_Controller {

public function __construct() {
  parent::__construct();
  $this->load->model('page_model');
  $this->load->library('template');
}

public function index() {
  $page = $this->page_model->get_page( $this->page_model->get_home_page() );

  if ($page === FALSE) {
   $this->error404();
  } else {
   $this->template->display($page);
  }
  
}

public function view($page_url = NULL) {
  $page = $this->page_model->get_page( $page_url );

  if ($page === FALSE) {
   $this->error404();
  } else {
   $this->template->display($page);
  }
}

public function error404() {
  $page['page_title'] = "Error 404: Page Not Found";
  $this->template->display($page,'error404');
}

}


Messages In This Thread
Not Finding My Model - by El Forum - 05-31-2012, 10:19 PM
Not Finding My Model - by El Forum - 05-31-2012, 10:56 PM
Not Finding My Model - by El Forum - 05-31-2012, 11:05 PM
Not Finding My Model - by El Forum - 05-31-2012, 11:19 PM
Not Finding My Model - by El Forum - 06-01-2012, 05:02 PM
Not Finding My Model - by El Forum - 06-03-2012, 10:06 PM



Theme © iAndrew 2016 - Forum software by © MyBB