You are here

public function SettingsForm::buildForm in Lightning Media 8

Same name and namespace in other branches
  1. 8.4 src/Form/SettingsForm.php \Drupal\lightning_media\Form\SettingsForm::buildForm()
  2. 8.2 src/Form/SettingsForm.php \Drupal\lightning_media\Form\SettingsForm::buildForm()
  3. 8.3 src/Form/SettingsForm.php \Drupal\lightning_media\Form\SettingsForm::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/SettingsForm.php, line 30

Class

SettingsForm
The settings form for controlling Lightning Media's behavior.

Namespace

Drupal\lightning_media\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form['choose_display'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Allow users to choose how to display embedded media'),
    '#default_value' => $this
      ->config('lightning_media.settings')
      ->get('entity_embed.choose_display'),
  ];
  return parent::buildForm($form, $form_state);
}