Created
December 12, 2008 09:59
-
-
Save markwatson/35061 to your computer and use it in GitHub Desktop.
Codeignitor full page templates.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
ob_start(); | |
/** | |
* Template Library | |
* | |
* @package Template | |
* @category Libraries | |
* @author Mark Watson | |
* @link http://markedup.org | |
* | |
* A simple way to load view pages. | |
*/ | |
class Template | |
{ | |
/** | |
* Auth constructor | |
* | |
* @access public | |
*/ | |
function __construct() | |
{ | |
$this->CI =& get_instance(); | |
} // Auth() | |
/** | |
* Show a template | |
* | |
* @access public | |
*/ | |
function show($view, $data=NULL, $headers=NULL, $other=FALSE) | |
{ | |
if (!$other) | |
{ | |
$this->CI->load->view('_header.php', $headers); | |
$this->CI->load->view($view, $data); | |
$this->CI->load->view('_footer.php', $headers); | |
} | |
else | |
{ | |
$this->CI->load->view($other.'/_header.php', $headers); | |
$this->CI->load->view($view, $data); | |
$this->CI->load->view($other.'/_footer.php', $headers); | |
} | |
} | |
} | |
/* End of file Template.php */ | |
/* Location: application/libraries */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment