function FormTestRebuildPreserveValuesForm::addMoreSubmitForm

Same name in other branches
  1. 9 core/modules/system/tests/modules/form_test/src/Form/FormTestRebuildPreserveValuesForm.php \Drupal\form_test\Form\FormTestRebuildPreserveValuesForm::addMoreSubmitForm()
  2. 8.9.x core/modules/system/tests/modules/form_test/src/Form/FormTestRebuildPreserveValuesForm.php \Drupal\form_test\Form\FormTestRebuildPreserveValuesForm::addMoreSubmitForm()
  3. 11.x core/modules/system/tests/modules/form_test/src/Form/FormTestRebuildPreserveValuesForm.php \Drupal\form_test\Form\FormTestRebuildPreserveValuesForm::addMoreSubmitForm()

File

core/modules/system/tests/modules/form_test/src/Form/FormTestRebuildPreserveValuesForm.php, line 86

Class

FormTestRebuildPreserveValuesForm
Form builder for testing preservation of values during a rebuild.

Namespace

Drupal\form_test\Form

Code

public function addMoreSubmitForm(array &$form, FormStateInterface $form_state) {
    // Rebuild, to test preservation of input values.
    $form_state->set('add_more', TRUE);
    $form_state->setRebuild();
}

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