ConfigHandlerGroup::submitForm

public ConfigHandlerGroup::submitForm(array &$form, FormStateInterface $form_state)

Form submission handler.

Parameters

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

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

Overrides ViewsFormBase::submitForm

File

core/modules/views_ui/src/Form/Ajax/ConfigHandlerGroup.php, line 95

Class

ConfigHandlerGroup
Provides a form for configuring grouping information for a Views UI handler.

Namespace

Drupal\views_ui\Form\Ajax

Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
public function submitForm(array &$form, FormStateInterface $form_state) {
  $view = $form_state->get('view');
  $item = &$form_state->get('handler')->options;
  $type = $form_state->get('type');
 
  $handler = Views::handlerManager($type)->getHandler($item);
  $executable = $view->getExecutable();
  $handler->init($executable, $executable->display_handler, $item);
 
  $handler->submitGroupByForm($form, $form_state);
 
  // Store the item back on the view
  $executable->setHandler($form_state->get('display_id'), $form_state->get('type'), $form_state->get('id'), $item);
 
  // Write to cache
  $view->cacheSet();
}
doc_Drupal
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.