You are here

public function XmlSitemapRebuildForm::submitForm in XML sitemap 8

Same name and namespace in other branches
  1. 2.x src/Form/XmlSitemapRebuildForm.php \Drupal\xmlsitemap\Form\XmlSitemapRebuildForm::submitForm()

Form submission handler.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Overrides ConfigFormBase::submitForm

File

src/Form/XmlSitemapRebuildForm.php, line 103

Class

XmlSitemapRebuildForm
Configure xmlsitemap settings for this site.

Namespace

Drupal\xmlsitemap\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {

  // Save any changes to the frontpage link.
  $entity_type_ids = $form_state
    ->getValue('entity_type_ids');
  $save_custom = $form_state
    ->getValue('save_custom');
  $batch = xmlsitemap_rebuild_batch($entity_type_ids, $save_custom);
  batch_set($batch);
  $form_state
    ->setRedirect('xmlsitemap.admin_search');
  parent::submitForm($form, $form_state);
}