Welcome Guest, Not a member yet? Register   Sign In
Noob working through tutorial
#11

(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.

O. M. G. !!!!

That's just embarassing! Thanks ever so much!
Reply
#12

(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()`.
Thanks!
Reply




Theme © iAndrew 2016 - Forum software by © MyBB