function Wizard::nextSubmit

Same name in other branches
  1. 4.0.x modules/ajax_example/src/Form/Wizard.php \Drupal\ajax_example\Form\Wizard::nextSubmit()

Ajax callback that moves the form to the next step and rebuild the form.

Parameters

array $form: The Form API form.

\Drupal\Core\Form\FormStateInterface $form_state: The FormState object.

Return value

array The Form API form.

File

modules/ajax_example/src/Form/Wizard.php, line 196

Class

Wizard
AJAX example wizard.

Namespace

Drupal\ajax_example\Form

Code

public function nextSubmit(array $form, FormStateInterface $form_state) {
    $form_state->setValue('step', $form_state->getValue('step') + 1);
    $form_state->setRebuild();
    return $form;
}