public function homeAction($type)
    {
        $typeEntity = $this->manager->getType($type);

        if (is_null($typeEntity)) {

            throw new NotFoundHttpException("Page not found");
        } else {
            $typeTemplate = $typeEntity->getTemplate();
            $template = is_null($typeTemplate) ?
                'ClarolineCoreBundle:Home:home.html.twig' :
                'ClarolineCoreBundle:Home\templates\custom:' . $typeTemplate;
            $response = $this->render(
                $template,
                array(
                    'type' => $type,
                    'region' => $this->renderRegions($this->manager->getRegionContents()),
                    'content' => $this->typeAction($type)->getContent()
                )
            );
            $response->headers->addCacheControlDirective('no-cache', true);
            $response->headers->addCacheControlDirective('max-age', 0);
            $response->headers->addCacheControlDirective('must-revalidate', true);
            $response->headers->addCacheControlDirective('no-store', true);
            $response->headers->addCacheControlDirective('expires', '-1');

            return $response;
        }
    }