Skip to content

Instantly share code, notes, and snippets.

@philsturgeon
Created December 8, 2010 10:30
Show Gist options
  • Save philsturgeon/733120 to your computer and use it in GitHub Desktop.
Save philsturgeon/733120 to your computer and use it in GitHub Desktop.
$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