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

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
2016-10-29 08:53:34
Comments
Leave a Comment

Please login to continue.