function Wizard::prevSubmit

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

Ajax callback that moves the form to the previous step.

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 213

Class

Wizard
AJAX example wizard.

Namespace

Drupal\ajax_example\Form

Code

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