public function sitemapAction()
    {
        /* @var ContentInterface[] $content */
        $contents = $this->get('opifer.content.content_manager')->getRepository()->findIndexable();

        $event = new SitemapEvent();

        foreach ($contents as $content) {
            $event->addUrl($this->generateUrl('_content', ['slug' => $content->getSlug()], UrlGeneratorInterface::ABSOLUTE_URL), $content->getUpdatedAt());
        }

        $dispatcher = $this->get('event_dispatcher');
        $dispatcher->dispatch(Events::POPULATE_SITEMAP, $event);

        return $this->render('OpiferCmsBundle:Sitemap:sitemap.xml.twig', [
            'urls' => $event->getUrls(),
        ]);
    }
public function sitemapAction()
    {
        /* @var ContentInterface[] $content */
        $contents = $this->get('opifer.content.content_manager')->getRepository()->findIndexable();

        $event = new SitemapEvent();

        foreach ($contents as $content) {
            $event->addUrl($this->generateUrl('_content', ['slug' => $content->getSlug()], UrlGeneratorInterface::ABSOLUTE_URL), $content->getUpdatedAt());
        }

        $dispatcher = $this->get('event_dispatcher');
        $dispatcher->dispatch(Events::POPULATE_SITEMAP, $event);

        return $this->render('OpiferCmsBundle:Sitemap:sitemap.xml.twig', [
            'urls' => $event->getUrls(),
        ]);
    }
public function sitemapAction ( ) { /* @var ContentInterface[] $content */ $ contents = $ this -> get ( 'opifer.content.content_manager' ) -> getRepository ( ) -> findIndexable ( ) ; $ event = new SitemapEvent ( ) ; foreach ( $ contents as $ content ) { $ event -> addUrl ( $ this -> generateUrl ( '_content' , [ 'slug' => $ content -> getSlug ( ) ] , UrlGeneratorInterface :: ABSOLUTE_URL ) , $ content -> getUpdatedAt ( ) ) ; } $ dispatcher = $ this -> get ( 'event_dispatcher' ) ; $ dispatcher -> dispatch ( Events :: POPULATE_SITEMAP , $ event ) ; return $ this -> render ( 'OpiferCmsBundle:Sitemap:sitemap.xml.twig' , [ 'urls' => $ event -> getUrls ( ) , ] ) ; }
Renders the sitemap.

@return Response
Renders the sitemap .