public function XmlSitemapGenerator::generatePage in XML sitemap 8
Same name and namespace in other branches
- 2.x src/XmlSitemapGenerator.php \Drupal\xmlsitemap\XmlSitemapGenerator::generatePage()
Generate one page (chunk) of the sitemap.
Parameters
XmlSitemapInterface $sitemap: An unserialized data array for an XML sitemap.
string $page: An integer of the specific page of the sitemap to generate.
Overrides XmlSitemapGeneratorInterface::generatePage
1 call to XmlSitemapGenerator::generatePage()
- XmlSitemapGenerator::regenerateBatchGenerate in src/
XmlSitemapGenerator.php - Batch callback; generate all pages of a sitemap.
File
- src/
XmlSitemapGenerator.php, line 253
Class
- XmlSitemapGenerator
- XmlSitemap generator service class.
Namespace
Drupal\xmlsitemapCode
public function generatePage(XmlSitemapInterface $sitemap, $page) {
$writer = new XmlSitemapWriter($sitemap, $page);
$writer
->startDocument();
$this
->generateChunk($sitemap, $writer, $page);
$writer
->endDocument();
return $writer
->getSitemapElementCount();
}