You are here

private function FormButton::showNextButton in Simple multi step form 8

Same name and namespace in other branches
  1. 8.x src/FormButton.php \Drupal\simple_multistep\FormButton::showNextButton()

Show next button.

Parameters

array $form: Reference to form array.

1 call to FormButton::showNextButton()
FormButton::render in src/FormButton.php
Render form button.

File

src/FormButton.php, line 59

Class

FormButton
Class FormButton.

Namespace

Drupal\simple_multistep

Code

private function showNextButton(array &$form) {
  $step_format_settings = $this->stepSettings->format_settings;
  if (count($this->steps) - 1 != $this->currentStep) {
    $form['actions']['next'] = [
      '#type' => 'button',
      '#value' => $step_format_settings['next_button_text'],
      '#validate' => [
        'simple_multistep_register_next_step',
      ],
      '#submit' => [],
      '#weight' => 0.1,
    ];
    $form['actions']['submit']['#access'] = FALSE;
  }
  else {
    $form['actions']['submit']['#access'] = TRUE;
    array_unshift($form['#validate'], 'simple_multistep_multistep_validate');
  }
}