You are here

public function YamlFormSubmissionResendForm::updateMessage in YAML Form 8

Handles switching between messages.

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

array An associative array containing an email message.

File

src/Form/YamlFormSubmissionResendForm.php, line 194

Class

YamlFormSubmissionResendForm
Defines a form that resends form submission.

Namespace

Drupal\yamlform\Form

Code

public function updateMessage(array $form, FormStateInterface $form_state) {
  $message_handler = $this
    ->getMessageHandler($form_state);
  $message = $message_handler
    ->getMessage($this->yamlformSubmission);
  foreach ($message as $key => $value) {
    $form['message'][$key]['#value'] = $value;
  }
  return $form['message'];
}