You are here

private function FormButton::showBackButton in Simple multi step form 8.x

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

Show back button.

Parameters

array $form: Reference to form array.

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

File

src/FormButton.php, line 37

Class

FormButton
Class FormButton.

Namespace

Drupal\simple_multistep

Code

private function showBackButton(array &$form) {
  $step_format_settings = $this->stepSettings->format_settings;
  if ($this->currentStep != 0 && !empty($step_format_settings['back_button_show'])) {

    // Add back button and remove validation.
    $form['actions']['back_button'] = array(
      '#type' => 'button',
      '#value' => $step_format_settings['back_button_text'],
      '#validate' => array(
        'simple_multistep_register_back',
      ),
      '#submit' => array(),
      '#limit_validation_errors' => array(),
    );
  }
}