/** * @param array $resource * @return string */ public function renderView(array $resource, Response $response) { $viewFormat = $this->getViewFormat($response); $this->view->setData(['resource' => $resource]); return $this->view->display("resource/show.{$viewFormat}.twig"); }
/** * @param array $errors */ public function renderErrors(array $errors, Response $response) { $viewFormat = $this->getViewFormat($response); $this->view->setData(['errors' => ['messages' => $errors]]); return $this->view->display("error/errors.{$viewFormat}.twig"); }