You are here

public function XmlSitemapForm::delete in XML sitemap 8

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

File

src/Form/XmlSitemapForm.php, line 95

Class

XmlSitemapForm
Provides a form for creating and editing xmlsitemap entities.

Namespace

Drupal\xmlsitemap\Form

Code

public function delete(array $form, FormStateInterface $form_state) {
  $request = $this
    ->getRequest();
  if ($request->query
    ->has('destination')) {
    $request->query
      ->remove('destination');
  }
  $form_state
    ->setRedirect('xmlsitemap.admin_delete', [
    'xmlsitemap' => $this->entity
      ->id(),
  ]);
}