public function CommentFormController::preview

Form submission handler for the 'preview' action.

Parameters

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

$form_state: A reference to a keyed array containing the current state of the form.

File

drupal/core/modules/comment/lib/Drupal/comment/CommentFormController.php, line 328
Definition of Drupal\comment\CommentFormController.

Class

CommentFormController
Base for controller for comment forms.

Namespace

Drupal\comment

Code

public function preview(array $form, array &$form_state) {
  $comment = $this
    ->getEntity($form_state);
  drupal_set_title(t('Preview comment'), PASS_THROUGH);
  $form_state['comment_preview'] = comment_preview($comment);
  $form_state['rebuild'] = TRUE;
}