You are here

public function GeneralSettingsForm::buildForm in Restrict Login or Role Access by IP Address 8.4

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/GeneralSettingsForm.php, line 34

Class

GeneralSettingsForm
Class GeneralSettingsForm.

Namespace

Drupal\restrict_by_ip\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('restrict_by_ip.settings');
  $form['restrict_by_ip_header'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Header to check'),
    '#description' => $this
      ->t('This is the HTTP request header that contains the client IP Address. It is sometimes re-written by reverse proxies and Content Distribution Networks.'),
    '#default_value' => $config
      ->get('header'),
    '#required' => TRUE,
  ];
  return parent::buildForm($form, $form_state);
}