You are here

public function OpignoTincanApiSettingsForm::buildForm in Opigno TinCan API 3.x

Same name and namespace in other branches
  1. 8 src/Form/OpignoTincanApiSettingsForm.php \Drupal\opigno_tincan_api\Form\OpignoTincanApiSettingsForm::buildForm()

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/OpignoTincanApiSettingsForm.php, line 23

Class

OpignoTincanApiSettingsForm
Class OpignoTincanApiSettingsForm.

Namespace

Drupal\opigno_tincan_api\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form['endpoint'] = [
    '#type' => 'textfield',
    '#title' => 'Endpoint',
    '#default_value' => \Drupal::config('opigno_tincan_api.settings')
      ->get('opigno_tincan_api_endpoint'),
  ];
  $form['username'] = [
    '#type' => 'textfield',
    '#title' => 'User',
    '#default_value' => \Drupal::config('opigno_tincan_api.settings')
      ->get('opigno_tincan_api_username'),
  ];
  $form['password'] = [
    '#type' => 'textfield',
    '#title' => 'Password',
    '#default_value' => \Drupal::config('opigno_tincan_api.settings')
      ->get('opigno_tincan_api_password'),
  ];
  $form['submit'] = [
    '#type' => 'submit',
    '#value' => 'Submit',
  ];
  return $form;
}