src/Sulu/Bundle/WebsiteBundle/Controller/SitemapController.php
public function sitemapPaginatedAction(Request $request, $alias, $page)
    {
        if (null !== ($response = $this->getDumpedSitemapResponse($request, $alias, $page))) {
            return $response;
        }

        $portal = $request->get('_sulu')->getAttribute('portal');
        $localization = $request->get('_sulu')->getAttribute('localization');
        if (!$localization) {
            $localization = $portal->getXDefaultLocalization();
        }

        $sitemap = $this->get('sulu_website.sitemap.xml_renderer')->renderSitemap(
            $alias,
            $page,
            $localization->getLocale(),
            $portal,
            $request->getHttpHost(),
            $request->getScheme()
        );

        if (!$sitemap) {
            return new Response(null, 404);
        }

        return $this->setCacheLifetime(new Response($sitemap));
    }
public function sitemapPaginatedAction(Request $request, $alias, $page)
    {
        if (null !== ($response = $this->getDumpedSitemapResponse($request, $alias, $page))) {
            return $response;
        }

        $portal = $request->get('_sulu')->getAttribute('portal');
        $localization = $request->get('_sulu')->getAttribute('localization');
        if (!$localization) {
            $localization = $portal->getXDefaultLocalization();
        }

        $sitemap = $this->get('sulu_website.sitemap.xml_renderer')->renderSitemap(
            $alias,
            $page,
            $localization->getLocale(),
            $portal,
            $request->getHttpHost(),
            $request->getScheme()
        );

        if (!$sitemap) {
            return new Response(null, 404);
        }

        return $this->setCacheLifetime(new Response($sitemap));
    }
public function sitemapPaginatedAction ( Request $ request , $ alias , $ page ) { if ( null !== ( $ response = $ this -> getDumpedSitemapResponse ( $ request , $ alias , $ page ) ) ) { return $ response ; } $ portal = $ request -> get ( '_sulu' ) -> getAttribute ( 'portal' ) ; $ localization = $ request -> get ( '_sulu' ) -> getAttribute ( 'localization' ) ; if ( ! $ localization ) { $ localization = $ portal -> getXDefaultLocalization ( ) ; } $ sitemap = $ this -> get ( 'sulu_website.sitemap.xml_renderer' ) -> renderSitemap ( $ alias , $ page , $ localization -> getLocale ( ) , $ portal , $ request -> getHttpHost ( ) , $ request -> getScheme ( ) ) ; if ( ! $ sitemap ) { return new Response ( null , 404 ) ; } return $ this -> setCacheLifetime ( new Response ( $ sitemap ) ) ; }
Render a single page for a single sitemap.xml provider.

@param Request $request
@param string $alias
@param int $page

@return Response
Render a single page for a single sitemap . xml provider .