function xmlsitemap_sitemap_uri in XML sitemap 2.x
Same name and namespace in other branches
- 8 xmlsitemap.module \xmlsitemap_sitemap_uri()
- 6.2 xmlsitemap.module \xmlsitemap_sitemap_uri()
- 7.2 xmlsitemap.module \xmlsitemap_sitemap_uri()
Returns the uri elements of an XML sitemap.
Parameters
\Drupal\xmlsitemap\XmlSitemapInterface $sitemap: The sitemap represented by and XmlSitemapInterface object.
Return value
array An array containing the 'path' and 'options' keys used to build the uri of the XML sitemap, and matching the signature of url().
Related topics
3 calls to xmlsitemap_sitemap_uri()
- XmlSitemapStorage::doLoadMultiple in src/
XmlSitemapStorage.php - Performs storage-specific loading of entities.
- XmlSitemapTestBase::drupalGetSitemap in tests/
src/ Functional/ XmlSitemapTestBase.php - Retrieves an XML sitemap.
- xmlsitemap_robotstxt in ./
xmlsitemap.module - Implements hook_robotstxt().
File
- ./
xmlsitemap.module, line 460 - xmlsitemap XML sitemap
Code
function xmlsitemap_sitemap_uri(XmlSitemapInterface $sitemap) {
$uri['path'] = 'sitemap.xml';
$uri['options'] = \Drupal::moduleHandler()
->invokeAll('xmlsitemap_context_url_options', [
$sitemap->context,
]);
$context = $sitemap->context;
\Drupal::moduleHandler()
->alter('xmlsitemap_context_url_options', $uri['options'], $context);
$uri['options'] += [
'absolute' => TRUE,
'base_url' => Settings::get('xmlsitemap_base_url', \Drupal::state()
->get('xmlsitemap_base_url')),
];
return $uri;
}