(03-06-2016, 05:47 PM)pdthinh Wrote: (03-06-2016, 11:29 AM)muckydog Wrote: Brand spanking new to CI ... You have a white space between <? and php, remove it and try again.
(03-06-2016, 11:29 AM)muckydog Wrote: Brand spanking new to CI ...
(03-06-2016, 05:51 PM)kenjis Wrote: (03-06-2016, 03:00 PM)muckydog Wrote: application/controllers/Pages.php <? php class Pages extends CI_Controller { public function view($page = 'home') { if ( ! file_exists(APPPATH.'/views/pages/'.$page.'.php')) { //whoops, we don't have a page for that! show_404; } $data['title'] = ucfirst($page); //capitalize the first letter $this->load->view('templates/header', $data); $this->load->view('pages/'.$page, $data); $this->load->view('templates/footer', $data); } } Probably this has nothing to do with your problem, but `show_404` is wrong. It should be `show_404()`.
(03-06-2016, 03:00 PM)muckydog Wrote: application/controllers/Pages.php <? php class Pages extends CI_Controller { public function view($page = 'home') { if ( ! file_exists(APPPATH.'/views/pages/'.$page.'.php')) { //whoops, we don't have a page for that! show_404; } $data['title'] = ucfirst($page); //capitalize the first letter $this->load->view('templates/header', $data); $this->load->view('pages/'.$page, $data); $this->load->view('templates/footer', $data); } }