You are here

public function DefaultContentExtraSettingsForm::buildForm in Default Content Extras 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 ConfigFormBase::buildForm

File

src/Form/DefaultContentExtraSettingsForm.php, line 34

Class

DefaultContentExtraSettingsForm
Class DefaultContentExtraSettingsForm.

Namespace

Drupal\default_content_extra\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('default_content_extra.settings');
  $form['path_alias'] = array(
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Path aliases'),
    '#default_value' => $config
      ->get('path_alias'),
    '#description' => $this
      ->t('This includes extra path alias data when exporting content and checks for it when importing.'),
  );
  $form['delete_users'] = array(
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Delete users 0 and 1'),
    '#default_value' => $config
      ->get('delete_users'),
    '#description' => $this
      ->t('Importing user 0 and 1 will fail so this will delete these json files after being exported when using the default-content-export-references command.'),
  );
  return parent::buildForm($form, $form_state);
}