function ViewAddForm::cancel

Same name in other branches
  1. 9 core/modules/views_ui/src/ViewAddForm.php \Drupal\views_ui\ViewAddForm::cancel()
  2. 8.9.x core/modules/views_ui/src/ViewAddForm.php \Drupal\views_ui\ViewAddForm::cancel()
  3. 11.x core/modules/views_ui/src/ViewAddForm.php \Drupal\views_ui\ViewAddForm::cancel()

Form submission handler for the 'cancel' action.

Parameters

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

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

File

core/modules/views_ui/src/ViewAddForm.php, line 224

Class

ViewAddForm
Form controller for the Views add form.

Namespace

Drupal\views_ui

Code

public function cancel(array $form, FormStateInterface $form_state) {
    $form_state->setRedirect('entity.view.collection');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.