You are here

public function ContentBuilderForm::nextSubmit in Schema.org configuration tool (RDF UI) 8

Submit handler for Content Builder next button. Capture the values from page one and store them away so they can be used at final submit time.

Parameters

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

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

File

rdf_builder/src/Form/ContentBuilderForm.php, line 86

Class

ContentBuilderForm

Namespace

Drupal\rdf_builder\Form

Code

public function nextSubmit(array &$form, FormStateInterface &$form_state) {
  $form_state
    ->set([
    'page_values',
    1,
  ], $form_state
    ->getValues());
  if ($form_state
    ->has([
    'page_values',
    2,
  ])) {
    $form_state
      ->setValues($form_state
      ->get([
      'page_values',
      2,
    ]));
  }

  // When form rebuilds, build method would be chosen based on to page_num.
  $form_state
    ->set('page_num', 2);
  $form_state
    ->setRebuild();
}