first commit
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user