/system/library/template.php
PHP | 26 lines | 19 code | 7 blank | 0 comment | 2 complexity | 886f06284c82f4deba40cd7ba17aa28a MD5 | raw file
- <?php
- final class Template {
- public $data = array();
-
- public function fetch($filename) {
- $file = DIR_TEMPLATE . $filename;
-
- if (file_exists($file)) {
- extract($this->data);
-
- ob_start();
-
- include($file);
-
- $content = ob_get_contents();
-
- ob_end_clean();
-
- return $content;
- } else {
- trigger_error('Error: Could not load template ' . $file . '!');
- exit();
- }
- }
- }
- ?>