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

        $homeType = $this->config->getParameter('home_redirection_type');

        switch ($homeType) {
            case 'url':
                $url = $this->config->getParameter('home_redirection_url');

                if ($url) {
                    return new RedirectResponse($url);
                }
                break;
            case 'login':
                return new RedirectResponse($this->router->generate('claro_security_login'));
            case 'new':
                return new RedirectResponse($this->router->generate('apiv2_home'));
        }

        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,
                [
                    '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;
        }
    }