Skip to content

Instantly share code, notes, and snippets.

@felixmc
Last active December 29, 2015 19:19
Show Gist options
  • Save felixmc/7716338 to your computer and use it in GitHub Desktop.
Save felixmc/7716338 to your computer and use it in GitHub Desktop.
<?php
class StaticPage extends CI_Controller {
public function __construct() {
parent::__construct();
$this->load->model('static_page_model');
}
public function index () {
$slug = $this->uri->segment(1);
$page = $this->static_page_model->getPage($slug);
if ($page) {
$this->load->view("static_page", $page);
} else
show_404();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment