PageRenderTime 39ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/system/library/template.php

https://bitbucket.org/jjasko/opencart_serbian
PHP | 26 lines | 19 code | 7 blank | 0 comment | 2 complexity | 886f06284c82f4deba40cd7ba17aa28a MD5 | raw file
  1. <?php
  2. final class Template {
  3. public $data = array();
  4. public function fetch($filename) {
  5. $file = DIR_TEMPLATE . $filename;
  6. if (file_exists($file)) {
  7. extract($this->data);
  8. ob_start();
  9. include($file);
  10. $content = ob_get_contents();
  11. ob_end_clean();
  12. return $content;
  13. } else {
  14. trigger_error('Error: Could not load template ' . $file . '!');
  15. exit();
  16. }
  17. }
  18. }
  19. ?>