You are here

public function HeartbeatSubCommentForm::buildForm in Heartbeat 8

Form constructor.

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 The form structure.

Overrides FormInterface::buildForm

File

src/Form/HeartbeatSubCommentForm.php, line 29

Class

HeartbeatSubCommentForm
Class HeartbeatSubCommentForm.

Namespace

Drupal\heartbeat\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form['comment_body'] = array(
    '#type' => 'textarea',
  );
  $form['post'] = array(
    '#type' => 'submit',
    '#description' => 'Comment',
    '#value' => t('Reply'),
    '#ajax' => [
      'callback' => '::commentAjaxSubmit',
      'progress' => array(
        'type' => 'throbber',
        'message' => t('Posting Reply'),
      ),
    ],
  );
  return $form;
}