You are here

public function TfaTestValidationPluginSetupPlugin::getSetupForm in Two-factor Authentication (TFA) 8

Get the setup form for the validation method.

Parameters

array $form: The configuration form array.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array Form API array.

Overrides TfaSetupInterface::getSetupForm

File

tests/modules/tfa_test_plugins/src/Plugin/TfaSetup/TfaTestValidationPluginSetupPlugin.php, line 38

Class

TfaTestValidationPluginSetupPlugin
TFA Test Validation Plugin Setup Plugin.

Namespace

Drupal\tfa_test_plugins\Plugin\TfaSetup

Code

public function getSetupForm(array $form, FormStateInterface $form_state) {
  $form['expected_field'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Expected field'),
    '#required' => TRUE,
  ];
  $form['actions']['#type'] = 'actions';
  $form['actions']['login'] = [
    '#type' => 'submit',
    '#button_type' => 'primary',
    '#value' => $this
      ->t('Verify and save'),
  ];
  return $form;
}