template object */ public function before() { if ( ! empty($this->template) and is_string($this->template)) { // Load the template $this->template = \View::forge($this->template); } return parent::before(); } /** * After controller method has run output the template * * @param Response $response */ public function after($response) { // If nothing was returned default to the template if (empty($response)) { $response = $this->template; } return parent::after($response); } }