You are here

public function Wizard::nextSubmit in Examples for Developers 8

Same name and namespace in other branches
  1. 3.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

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;
}