Created
December 8, 2010 10:30
-
-
Save philsturgeon/733120 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
$route['default_controller'] = 'pages'; | |
$route['404'] = 'pages'; | |
<?php defined('BASEPATH') OR exit('No direct script access allowed'); | |
class Pages extends CI_Controller { | |
public function _remap() | |
{ | |
$method = $this->uri->segment(1, 'home'); | |
if ( ! method_exists($this, $method)) | |
{ | |
$method = 'not_found'; | |
} | |
$this->$method(); | |
} | |
private function home() | |
{ | |
$this->template->build('home'); | |
} | |
private function about() | |
{ | |
$this->template->build('about'); | |
} | |
private function prizes() | |
{ | |
$this->template->build('prizes'); | |
} | |
private function not_found() | |
{ | |
show_error('OH DEAR GOD NO!'); | |
} | |
} | |
/* End of file pages.php */ | |
/* Location: ./application/controllers/pages.php */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment