public function getTwigResponse(View $view, $templateName) { if (!$this->twig) { throw new RuntimeException("Can't call getTwigResponse without calling setTwig()"); } $data = $view->getData(); $html = ''; foreach ($view->getActions() as $action) { $html .= $this->renderWidget($action); } $data['materia_actions'] = $html; $data['materia_view'] = $view; $html = ''; foreach ($view->getBreadcrumbs() as $action) { $html .= $this->renderWidget($action); } $data['materia_breadcrumbs'] = $html; $html = $this->twig->render($templateName, $data); $response = new Response($html); return $response; }