30 lines
1.1 KiB
PHP
30 lines
1.1 KiB
PHP
<?php
|
|
class Pages extends Default_Master_Controller{
|
|
public function __construct() {
|
|
parent::__construct();
|
|
$this->load->model('news_model');
|
|
$this->load->model('gallery_model');
|
|
$this->load->helper('html');
|
|
$this->load->helper('url');
|
|
}
|
|
public function view($page = 'start') {
|
|
if(!file_exists('application/views/pages/'.$page.'.php')) {
|
|
// whoops we dont have a page for that
|
|
show_404();
|
|
} else {
|
|
if($page == 'start') {
|
|
$data['paintings'] = $this->gallery_model->get_paintings_on_display_limit(10);
|
|
$data['news'] = $this->news_model->get_news();
|
|
$this->master->write_view('content', 'pages/' .$page, $data);
|
|
} else {
|
|
$this->master->write_view('content', 'pages/' .$page,'');
|
|
}
|
|
//$this->master->write('frm_contact', $this->forms_model->contact());
|
|
$this->master->write('title', $this->config->item('site_name') . ' : ' . ucfirst($page));
|
|
$this->master->write('current_page', $page);
|
|
$this->master->render();
|
|
}
|
|
}
|
|
}
|
|
?>
|