You are here

public function ModulePreviewForm::submitForm in Opigno module 8

Same name and namespace in other branches
  1. 3.x src/Form/ModulePreviewForm.php \Drupal\opigno_module\Form\ModulePreviewForm::submitForm()

Form submission handler.

Parameters

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

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

Overrides FormInterface::submitForm

File

src/Form/ModulePreviewForm.php, line 106

Class

ModulePreviewForm
Add External package form.

Namespace

Drupal\opigno_module\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $inputs = $form_state
    ->getUserInput();
  if (isset($inputs['_triggering_element_name']) && $inputs['_triggering_element_name'] == 'next_button') {
    $this->step++;
  }
  elseif (isset($inputs['_triggering_element_name']) && $inputs['_triggering_element_name'] == 'previous_button') {
    $this->step--;
  }
  $form_state
    ->setRebuild();
}