You are here

public function EditForm::deleteSubmit in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/path/src/Form/EditForm.php \Drupal\path\Form\EditForm::deleteSubmit()

Submits the delete form.

File

core/modules/path/src/Form/EditForm.php, line 54
Contains \Drupal\path\Form\EditForm.

Class

EditForm
Provides the path edit form.

Namespace

Drupal\path\Form

Code

public function deleteSubmit(array &$form, FormStateInterface $form_state) {
  $url = new Url('path.delete', array(
    'pid' => $form_state
      ->getValue('pid'),
  ));
  if ($this
    ->getRequest()->query
    ->has('destination')) {
    $url
      ->setOption('query', $this
      ->getDestinationArray());
    $this
      ->getRequest()->query
      ->remove('destination');
  }
  $form_state
    ->setRedirectUrl($url);
}