32 lines
949 B
PHP
32 lines
949 B
PHP
<?php
|
|
class Template {
|
|
//ci instance
|
|
private $CI;
|
|
//template Data
|
|
var $template_data = array();
|
|
var $sideMenu = 'side_menu';
|
|
var $header = 'header';
|
|
var $footer = 'footer';
|
|
|
|
public function __construct()
|
|
{
|
|
$this->CI =& get_instance();
|
|
}
|
|
|
|
function set($content_area, $value)
|
|
{
|
|
$this->template_data[$content_area] = $value;
|
|
}
|
|
|
|
function load($view = '' , $view_data = array(), $return = FALSE)
|
|
{
|
|
$siteMenuData['selectedTab'] = $view_data['selectedTab'];
|
|
$this->set('header', $this->CI->load->view($this->header, null, TRUE));
|
|
$this->set('footer', $this->CI->load->view($this->footer, null, TRUE));
|
|
$this->set('side_menu', $this->CI->load->view($this->sideMenu, $siteMenuData, TRUE));
|
|
$this->set('contents' , $this->CI->load->view($view, $view_data, TRUE));
|
|
$this->CI->load->view('layouts/default_layout', $this->template_data);
|
|
}
|
|
}
|
|
?>
|