/** Отрисовка шаблона */ public function render($template = null) { $this->exception = null; if (is_null($template)) { $template = $this->template; } //Защищаем от затирания extract`ом $this->cur_template = $template; try { if ($this->cur_template) { ob_start(); extract($this->getVars(), EXTR_OVERWRITE); include $this->getTemplatePath($this->cur_template); return ob_get_clean(); } else { Exception::NoTemplate(); } } catch (\Exception $e) { $this->exception = $e; if (self::$debug) { return sprintf('%s: [%s] %s', get_class($e), $e->getCode(), $e->getMessage()); } return ''; } }