protected function DefaultSitemapGenerator::addLinks in Simple XML sitemap 8.3
Same name and namespace in other branches
- 4.x src/Plugin/simple_sitemap/SitemapGenerator/DefaultSitemapGenerator.php \Drupal\simple_sitemap\Plugin\simple_sitemap\SitemapGenerator\DefaultSitemapGenerator::addLinks()
Adds URL elements to the sitemap.
Parameters
array $links:
1 call to DefaultSitemapGenerator::addLinks()
- DefaultSitemapGenerator::getXml in src/
Plugin/ simple_sitemap/ SitemapGenerator/ DefaultSitemapGenerator.php - Generates and returns a sitemap chunk.
File
- src/
Plugin/ simple_sitemap/ SitemapGenerator/ DefaultSitemapGenerator.php, line 83
Class
- DefaultSitemapGenerator
- Class DefaultSitemapGenerator @package Drupal\simple_sitemap\Plugin\simple_sitemap\SitemapGenerator
Namespace
Drupal\simple_sitemap\Plugin\simple_sitemap\SitemapGeneratorCode
protected function addLinks(array $links) {
foreach ($links as $url_data) {
$this->writer
->startElement('url');
$this
->addUrl($url_data);
$this->writer
->endElement();
}
}