Codeigniter_Blog_App/application/controllers/Pages.php

23 lines
479 B
PHP
Raw Normal View History

2024-07-11 04:23:32 +00:00
<?php
//This controller only manipulates the pages
class Pages extends CI_Controller {
public function view($page = 'home')
{
if(!file_exists(APPPATH.'views/pages/'.$page.'.php')){
show_404();
}
//storing the title of the page
$data['title'] = ucfirst($page);
$this->load->view('templates/header');
$this->load->view('pages/'.$page, $data);
$this->load->view('templates/footer');
}
}