public function Select2OptgroupForm::submitForm in Select 2 8
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 FormInterface::submitForm
File
- tests/
modules/ select2_form_test/ src/ Form/ Select2OptgroupForm.php, line 49
Class
- Select2OptgroupForm
- Test form to test the select2 element.
Namespace
Drupal\select2_form_test\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$form_state
->setResponse(new JsonResponse($form_state
->getValues()));
}