main/core/Controller/HomeController.php
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;
        }
    }
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;
        }
    }
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 ; } }
Render the home page of the platform.

@Route("/type/{type}", name="claro_get_content_by_type", options = {"expose" = true})
@Route("/", name="claro_index", defaults={"type" = "home"}, options = {"expose" = true})

@return Response
Render the home page of the platform .