setTemplate($template); $this->data = $data; } private function setTemplate($template) { if (file_exists(static::TPL_PATH . mb_strtolower($template) . '.phtml')) { $this->template = static::TPL_PATH . mb_strtolower($template) . '.phtml'; } } public function render() { ob_start(); include($this->template); $pageContent = ob_get_contents(); ob_end_clean(); return $pageContent; } }