public function ContactStorageSettingsForm::buildForm in Contact Storage 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 ConfigFormBase::buildForm
File
- src/
Form/ ContactStorageSettingsForm.php, line 32
Class
- ContactStorageSettingsForm
- Defines a class for contact_storage's settings form.
Namespace
Drupal\contact_storage\FormCode
public function buildForm(array $form, FormStateInterface $form_state) {
$config = $this
->config('contact_storage.settings');
// Global setting.
$form['send_html'] = [
'#type' => 'checkbox',
'#title' => t('Send HTML'),
'#description' => t('Whether the mails should be sent as HTML. A module like <a href="https://www.drupal.org/project/swiftmailer">Swiftmailer</a> is needed for this feature. This has only been tested with the Swiftmailer module, other modules might not work out of the box and will not use the provided default template.'),
'#default_value' => $config
->get('send_html'),
];
return parent::buildForm($form, $form_state);
}