You are here

public function SettingsForm::buildForm in Field Defaults 8

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/SettingsForm.php, line 60

Class

SettingsForm
Class SettingsForm.

Namespace

Drupal\field_defaults\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this->configFactory
    ->getEditable('field_defaults.configuration');
  $form['update_date'] = [
    '#title' => $this
      ->t('Retain original entity updated time'),
    '#description' => $this
      ->t('When default values are updated retain the entity original update date.'),
    '#type' => 'checkbox',
    '#default_value' => $config
      ->get('update_date'),
  ];
  $form['submit'] = [
    '#type' => 'submit',
    '#value' => $this
      ->t('Submit'),
  ];
  return $form;
}