You are here

public function StructureSyncForm::buildForm in Structure Sync 2.x

Same name and namespace in other branches
  1. 8 src/Form/StructureSyncForm.php \Drupal\structure_sync\Form\StructureSyncForm::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/StructureSyncForm.php, line 32

Class

StructureSyncForm
Import and export form for content in structure, like taxonomy terms.

Namespace

Drupal\structure_sync\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form['title'] = [
    '#type' => 'page_title',
    '#title' => $this
      ->t('General settings'),
  ];
  $log = $this
    ->config('structure_sync.data')
    ->get('log');
  if ($log === NULL) {
    $log = TRUE;
  }
  $form['options'] = [
    '#type' => 'fieldset',
    '#title' => $this
      ->t('Options'),
  ];
  $form['options']['log'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Enable logging'),
    '#default_value' => $log,
  ];
  $form['submit'] = [
    '#type' => 'submit',
    '#button_type' => 'primary',
    '#value' => $this
      ->t('Save'),
  ];
  return $form;
}