You are here

public function CloseBlockClearCookieForm::buildForm in Close Block 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 FormInterface::buildForm

File

src/Form/CloseBlockClearCookieForm.php, line 23

Class

CloseBlockClearCookieForm
Provides a module settings form.

Namespace

Drupal\closeblock\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form['resetCookie'] = [
    '#type' => 'submit',
    '#value' => $this
      ->t('Reset Cookie'),
    '#description' => $this
      ->t('Reset cookie to visible block'),
    '#id' => 'closeblock-clear-cookie-button',
  ];
  $form['#attached']['library'][] = 'closeblock/closeblock';
  return $form;
}