You are here

public function SettingsForm::buildForm in Better Formats 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/SettingsForm.php, line 32

Class

SettingsForm
Class SettingsForm.

Namespace

Drupal\better_formats\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('better_formats.settings');
  $form['control'] = [
    '#type' => 'fieldset',
    '#title' => $this
      ->t('Control'),
  ];
  $form['control']['per_field_core'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Use field default'),
    '#description' => $this
      ->t('Use the core field module default value to set the default format. This will force the default format even when the default field value is empty. To set a default format you must re-edit a text field after saving it with the "Filtered text" option turned on.'),
    '#default_value' => $config
      ->get('per_field_core'),
  ];
  return parent::buildForm($form, $form_state);
}