You are here

public function DataPolicySettingsForm::buildForm in Data Policy 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/DataPolicySettingsForm.php, line 32

Class

DataPolicySettingsForm
Class DataPolicySettingsForm.

Namespace

Drupal\data_policy\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('data_policy.data_policy');
  $form['consent_text'] = [
    '#type' => 'textarea',
    '#title' => $this
      ->t('Consent text'),
    '#default_value' => $config
      ->get('consent_text'),
    '#description' => $this
      ->t('Each line is a separate checkbox. Accordingly, in order to have several checkboxes, you need to add several lines. To insert an entity into a string, you need to use tokens according to a special template: [id:1] where 1 is the entity ID from the page "/admin/config/people/data-policy", if the checkbox must be required, then after the entity ID you need to insert the "*" character.'),
    '#rows' => 5,
  ];
  return parent::buildForm($form, $form_state);
}