Created
January 9, 2013 12:07
-
-
Save rihenperry/4492647 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Pages extends CI_Controller { | |
public function view($page = 'home') | |
{ | |
if ( ! file_exists('application/views/pages/'.$page.'.php')) { | |
// show the fatal 404 error. | |
// the below function is CodeIgnitor's native built-in function | |
show_404(); | |
} | |
$data['title'] = ucfirst($page); | |
$this->load->view('templates/header',$data); | |
$this->load->view('pages/'.$page,$data); | |
$this->load->view('templates/footer',$data); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment