src/Silvestra/Component/Sitemap/Render/XmlRender.php
public function renderSitemapIndex(array $entries)
    {
        $data = '<?xml version="1.0" encoding="UTF-8"?>' . PHP_EOL;
        $data .= '<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . PHP_EOL;
        foreach ($entries as $entry) {
            $data .= '    <sitemap>' . PHP_EOL;
            $data .= '        <loc>' . $entry->getLoc() . '</loc>' . PHP_EOL;
            $data .= '        <lastmod>' . $entry->getLastMod() . '</lastmod>' . PHP_EOL;
            $data .= '    </sitemap>' . PHP_EOL;
        }

        $data .= '</sitemapindex>' . PHP_EOL;

        return $data;
    }
public function renderSitemapIndex(array $entries)
    {
        $data = '<?xml version="1.0" encoding="UTF-8"?>' . PHP_EOL;
        $data .= '<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . PHP_EOL;
        foreach ($entries as $entry) {
            $data .= '    <sitemap>' . PHP_EOL;
            $data .= '        <loc>' . $entry->getLoc() . '</loc>' . PHP_EOL;
            $data .= '        <lastmod>' . $entry->getLastMod() . '</lastmod>' . PHP_EOL;
            $data .= '    </sitemap>' . PHP_EOL;
        }

        $data .= '</sitemapindex>' . PHP_EOL;

        return $data;
    }
public function renderSitemapIndex ( array $ entries ) { $ data = '<?xml version="1.0" encoding="UTF-8"?>' . PHP_EOL ; $ data .= '<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . PHP_EOL ; foreach ( $ entries as $ entry ) { $ data .= '    <sitemap>' . PHP_EOL ; $ data .= '        <loc>' . $ entry -> getLoc ( ) . '</loc>' . PHP_EOL ; $ data .= '        <lastmod>' . $ entry -> getLastMod ( ) . '</lastmod>' . PHP_EOL ; $ data .= '    </sitemap>' . PHP_EOL ; } $ data .= '</sitemapindex>' . PHP_EOL ; return $ data ; }
Render sitemap index xml.

@param array|SitemapEntryInterface[] $entries

@return string
Render sitemap index xml .