/** * Render a view and store the result in a response object (created if needed) * * @param string $name * @param array $data * @param null|\snb\http\Response $response * * @return \snb\http\Response */ public function renderResponse($name, array $data = array(), Response $response = null) { // create a response, if one wasn't provided if ($response == null) { $response = new Response(); } // render the view into the response and return it $response->setContent($this->render($name, $data)); return $response; }