ViewEditForm::submitDisplayDisable

public ViewEditForm::submitDisplayDisable($form, FormStateInterface $form_state)

Submit handler to disable display.

File

core/modules/views_ui/src/ViewEditForm.php, line 611

Class

ViewEditForm
Form controller for the Views edit form.

Namespace

Drupal\views_ui

Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
public function submitDisplayDisable($form, FormStateInterface $form_state) {
  $view = $this->entity;
  $id = $form_state->get('display_id');
  $view->getExecutable()->displayHandlers->get($id)->setOption('enabled', FALSE);
 
  // Store in cache
  $view->cacheSet();
 
  // Redirect to the top-level edit page.
  $form_state->setRedirect('entity.view.edit_display_form', array(
    'view' => $view->id(),
    'display_id' => $id,
  ));
}
doc_Drupal
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.