public ViewEditForm::submitDisplayDelete($form, FormStateInterface $form_state)
Submit handler to delete a display from a view.
File
- core/modules/views_ui/src/ViewEditForm.php, line 629
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 submitDisplayDelete( $form , FormStateInterface $form_state ) { $view = $this ->entity; $display_id = $form_state ->get( 'display_id' ); // Mark the display for deletion. $displays = $view ->get( 'display' ); $displays [ $display_id ][ 'deleted' ] = TRUE; $view ->set( 'display' , $displays ); $view ->cacheSet(); // Redirect to the top-level edit page. The first remaining display will // become the active display. $form_state ->setRedirectUrl( $view ->urlInfo( 'edit-form' )); } |
Please login to continue.