public function DefaultForm::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
- modules/
statusmessage/ src/ Form/ DefaultForm.php, line 46
Class
- DefaultForm
- Class DefaultForm.
Namespace
Drupal\statusmessage\FormCode
public function buildForm(array $form, FormStateInterface $form_state) {
$form['message'] = [
'#type' => 'textarea',
'#title' => $this
->t('Message'),
'#description' => $this
->t('Status Message'),
];
$form['media'] = [
'#type' => 'radio',
'#title' => $this
->t('Media'),
'#description' => $this
->t('Media'),
];
$form['post'] = [
'#type' => 'submit',
'#title' => $this
->t('Post'),
'#description' => $this
->t('Post the message'),
];
$form['submit'] = [
'#type' => 'submit',
'#value' => $this
->t('Submit'),
];
return $form;
}