public function ViewEditFormController::cancel

Form submission handler for the 'cancel' action.

Parameters

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

array $form_state: A reference to a keyed array containing the current state of the form.

File

drupal/core/modules/views/views_ui/lib/Drupal/views_ui/ViewEditFormController.php, line 287
Contains Drupal\views_ui\ViewEditFormController.

Class

ViewEditFormController
Form controller for the Views edit form.

Namespace

Drupal\views_ui

Code

public function cancel(array $form, array &$form_state) {

  // Remove this view from cache so edits will be lost.
  $view = $this
    ->getEntity($form_state);
  drupal_container()
    ->get('user.tempstore')
    ->get('views')
    ->delete($view
    ->get('name'));
  $form_state['redirect'] = 'admin/structure/views';
}