You are here

public function SettingsForm::buildForm in Synonyms 2.0.x

Same name in this branch
  1. 2.0.x src/Form/SettingsForm.php \Drupal\synonyms\Form\SettingsForm::buildForm()
  2. 2.0.x modules/synonyms_list_field/src/Form/SettingsForm.php \Drupal\synonyms_list_field\Form\SettingsForm::buildForm()

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

modules/synonyms_list_field/src/Form/SettingsForm.php, line 33

Class

SettingsForm
Synonyms list field settings form.

Namespace

Drupal\synonyms_list_field\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {

  // The 'Include entity label' checkbox.
  $form['include_entity_label'] = [
    '#type' => 'checkbox',
    '#title' => t('Include entity label'),
    '#default_value' => $this
      ->config('synonyms_list_field.settings')
      ->get('include_entity_label'),
    '#description' => $this
      ->t('If checked, the entity label is prepended to computed "Synonyms list" field.'),
  ];
  return parent::buildForm($form, $form_state);
}