You are here

public function SimplesitemapSettingsForm::generate_sitemap in Simple XML sitemap 8

File

src/Form/SimplesitemapSettingsForm.php, line 100
Contains \Drupal\simplesitemap\Form\SimplesitemapSettingsForm.

Class

SimplesitemapSettingsForm
SimplesitemapSettingsFrom

Namespace

Drupal\simplesitemap\Form

Code

public function generate_sitemap(array &$form, FormStateInterface $form_state) {
  $sitemap = new Simplesitemap();
  $sitemap
    ->generate_sitemap();
  drupal_set_message(t("The <a href='@url' target='_blank'>XML sitemap</a> has been regenerated for all languages.", array(
    '@url' => $GLOBALS['base_url'] . '/sitemap.xml',
  )));
}