function MessageForm::preview

Same name in other branches
  1. 8.9.x core/modules/contact/src/MessageForm.php \Drupal\contact\MessageForm::preview()
  2. 10 core/modules/contact/src/MessageForm.php \Drupal\contact\MessageForm::preview()
  3. 11.x core/modules/contact/src/MessageForm.php \Drupal\contact\MessageForm::preview()

Form submission handler for the 'preview' action.

File

core/modules/contact/src/MessageForm.php, line 185

Class

MessageForm
Form controller for contact message forms.

Namespace

Drupal\contact

Code

public function preview(array $form, FormStateInterface $form_state) {
    $message = $this->entity;
    $message->preview = TRUE;
    $form_state->setRebuild();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.