function TableDragTestForm::submitForm

Same name and namespace in other branches
  1. 9 core/modules/system/tests/modules/tabledrag_test/src/Form/TableDragTestForm.php \Drupal\tabledrag_test\Form\TableDragTestForm::submitForm()
  2. 10 core/modules/system/tests/modules/tabledrag_test/src/Form/TableDragTestForm.php \Drupal\tabledrag_test\Form\TableDragTestForm::submitForm()
  3. 11.x core/modules/system/tests/modules/tabledrag_test/src/Form/TableDragTestForm.php \Drupal\tabledrag_test\Form\TableDragTestForm::submitForm()

Overrides FormInterface::submitForm

File

core/modules/system/tests/modules/tabledrag_test/src/Form/TableDragTestForm.php, line 148

Class

TableDragTestForm
Provides a form for draggable table testing.

Namespace

Drupal\tabledrag_test\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
    $test_table = [];
    foreach ($form_state->getValue('table') as $row) {
        $test_table[$row['id']] = $row;
    }
    $this->state
        ->set('tabledrag_test_table', $test_table);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.