template = new View($this->template); if ($this->auto_render == true) { // Render the template immediately after the controller method Event::add('system.post_controller', array($this, 'Xrender')); } } /** * Render the loaded template. */ public function Xrender() { if ($this->auto_render == true) { // Render the template when the class is destroyed $this->template->render(true); } } } // End Template_Controller