You are here

public function SettingsForm::buildForm in Anonymous CSRF Token 2.x

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/SettingsForm.php, line 32

Class

SettingsForm
Class SettingsForm.

Namespace

Drupal\anonymous_token\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('anonymous_token.settings');
  $form['force_single_use'] = [
    '#title' => $this
      ->t('Force single use tokens'),
    '#type' => 'checkbox',
    '#default_value' => $config
      ->get('force_single_use') ?? FALSE,
  ];
  return parent::buildForm($form, $form_state);
}