public ProfileForm::editCancelSubmit($form, FormStateInterface $form_state)
Provides a submit handler for the 'Cancel account' button.
File
- core/modules/user/src/ProfileForm.php, line 55
 
Class
- ProfileForm
 - Form handler for the profile forms.
 
Namespace
Drupal\user
Code
public function editCancelSubmit($form, FormStateInterface $form_state) {
  $destination = array();
  $query = $this->getRequest()->query;
  if ($query->has('destination')) {
    $destination = array('destination' => $query->get('destination'));
    $query->remove('destination');
  }
  // We redirect from user/%/edit to user/%/cancel to make the tabs disappear.
  $form_state->setRedirect(
  'entity.user.cancel_form', 
  array('user' => $this->entity->id()), 
  array('query' => $destination)
  );
}
Please login to continue.