You are here

public function IpLoginSettingsForm::buildForm in IP Login 4.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/IpLoginSettingsForm.php, line 75

Class

IpLoginSettingsForm
Configure ip_login settings.

Namespace

Drupal\ip_login\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form = parent::buildForm($form, $form_state);
  $config = $this
    ->config('ip_login.settings');
  $form['auto_login'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Login automatically'),
    '#description' => $this
      ->t('When an anonymous user accesses any page of the site, the module will attempt to log them in automatically.'),
    '#default_value' => $config
      ->get('auto_login'),
  ];
  $form['form_login'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Login form'),
    '#description' => $this
      ->t('An additional action link is added to the user login form.'),
    '#default_value' => $config
      ->get('form_login'),
  ];
  return $form;
}