You are here

protected function YamlFormSubmissionForm::getPreviousPage in YAML Form 8

Get previous page's key.

Parameters

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

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

Return value

null|string The previous page's key. NULL if there is no previous page.

1 call to YamlFormSubmissionForm::getPreviousPage()
YamlFormSubmissionForm::previous in src/YamlFormSubmissionForm.php
Form submission handler for the 'previous' action.

File

src/YamlFormSubmissionForm.php, line 1000

Class

YamlFormSubmissionForm
Provides a form to collect and edit submissions.

Namespace

Drupal\yamlform

Code

protected function getPreviousPage(array &$form, FormStateInterface $form_state) {
  $pages = $this
    ->getPages($form, $form_state);
  $current_page = $this
    ->getCurrentPage($form, $form_state);
  return YamlFormArrayHelper::getPreviousKey($pages, $current_page);
}