public function fetch($tpl, $display = false) { $__inc_path = ini_set('include_path', $this->tpl_dir); $__err_rep = ini_set('error_reporting', 0); // $__sot = ini_set('short_open_tag', '1'); $this->helpers = TemplateHelpers::instance(); $template = $this; extract($this->vars); if ($display) { include $tpl; $contents = true; } else { ob_start(); include $tpl; $contents = ob_get_contents(); ob_end_clean(); } ini_set('include_path', $__inc_path); ini_set('error_reporting', $__err_rep); // ini_set('short_open_tag', $__sot); return $contents; }