<commit_before><?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Page extends CI_Controller {

	public function __construct()
	{
		parent::__construct();
		// load up access page info
		$this->load->model('page_model');
	}

	// function to view all pages
	public function index() {
		$data['pages'] = $this->page_model->get_all_pages();

		$data['head_title'] = 'All Pages';
		$data['page_title'] = 'All Pages';

		// output page
    	$this->load->view('header', $data);
    	$this->load->view('pages', $data);
		$this->load->view('footer', $data);
	}

  // function to view a given static page eg. about pages
	public function view($slug = 'home')
	{

	    //set data variables

		// fetch the page data
		$data['page'] = $this->page_model->get_page($slug);

		if (!$data['page']) {
			show_404();<commit_msg>adding support in page.php controller for handling missing home page<commit_after><?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Page extends CI_Controller {

	public function __construct()
	{
		parent::__construct();
		// load up access page info
		$this->load->model('page_model');
	}

	// function to view all pages
	public function index() {
		$data['pages'] = $this->page_model->get_all_pages();

		$data['head_title'] = 'All Pages';
		$data['page_title'] = 'All Pages';

		// output page
    	$this->load->view('header', $data);
    	$this->load->view('pages', $data);
		$this->load->view('footer', $data);
	}

  // function to view a given static page eg. about pages
	public function view($slug = 'home')
	{

	    //set data variables

		// fetch the page data
		$data['page'] = $this->page_model->get_page($slug);

		if (!$data['page']) {
			if ($slug == 'home') {
				$data['page']['title'] = 'No home page defined';
				$data['page']['content'] = '<p>Please <a href="page/add/home">create a home page</a>!</p>';
				$data['show_edit_links'] = FALSE;
			} else {
				show_404();
			}
		} else {
			$data['show_edit_links'];
{'fraction_non_alphanumeric': 0.18955223880597014, 'fraction_numerical': 0.0029850746268656717, 'mean_word_length': 3.788095238095238, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5194204', 'n_tokens_mistral': 720, 'n_tokens_neox': 655, 'n_words': 172}