You are here

public function FooCaptchaSettingsForm::buildForm in CAPTCHA Pack 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

foo_captcha/src/Form/FooCaptchaSettingsForm.php, line 30

Class

FooCaptchaSettingsForm
Foo CAPTCHA settings form.

Namespace

Drupal\foo_captcha\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('foo_captcha.settings');
  $form = [];
  $form['foo_captcha_ignore_spaces'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Ignore spaces in the response'),
    '#default_value' => $config
      ->get('foo_captcha_ignore_spaces'),
  ];
  return parent::buildForm($form, $form_state);
}