You are here

public function WSDataAdminForm::buildForm in Web Service Data 2.0.x

Same name and namespace in other branches
  1. 8 src/Form/WSDataAdminForm.php \Drupal\wsdata\Form\WSDataAdminForm::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 ConfigFormBase::buildForm

File

src/Form/WSDataAdminForm.php, line 56

Class

WSDataAdminForm
Admin form for the WSData module.

Namespace

Drupal\wsdata\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form['debug_mode'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Debug Mode'),
    '#description' => $this
      ->t('Deubg mode logs and prints all queries'),
    '#default_value' => $this->state
      ->get('wsdata_debug_mode'),
  ];
  $form['performance_log'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Performance log'),
    '#description' => $this
      ->t('Log WSData performace to watchdog'),
    '#default_value' => $this->state
      ->get('wsdata_performance_log', 0),
  ];
  return parent::buildForm($form, $form_state);
}