function 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\FormCode
public function prevSubmit(array $form, FormStateInterface $form_state) {
$form_state->setValue('step', $form_state->getValue('step') - 1);
$form_state->setRebuild();
return $form;
}