You are here

public function Settings::buildForm in DRD Agent 4.0.x

Same name and namespace in other branches
  1. 8.3 src/Form/Settings.php \Drupal\drd_agent\Form\Settings::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/Settings.php, line 47

Class

Settings
Configure drd-agent settings for this site.

Namespace

Drupal\drd_agent\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) : array {
  $state = \Drupal::state();
  $form['debug_mode'] = [
    '#type' => 'checkbox',
    '#title' => t('Debug mode'),
    '#default_value' => $state
      ->get('drd_agent.debug_mode', FALSE),
  ];
  $form['actions'] = [
    '#type' => 'actions',
  ];
  $form['actions']['submit'] = [
    '#type' => 'submit',
    '#value' => $this
      ->t('Submit'),
  ];
  return $form;
}