You are here

public function FooTableConfigForm::buildForm in FooTable 8

Same name and namespace in other branches
  1. 8.2 src/Form/FooTableConfigForm.php \Drupal\footable\Form\FooTableConfigForm::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/FooTableConfigForm.php, line 30

Class

FooTableConfigForm
Configuration form for FooTable.

Namespace

Drupal\footable\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form['config'] = [
    '#type' => 'vertical_tabs',
    '#default_tab' => 'edit-plugin',
  ];
  $form['plugin'] = [
    '#type' => 'details',
    '#title' => $this
      ->t('Plugin'),
    '#group' => 'config',
  ];
  $form['plugin']['footable_plugin_type'] = [
    '#type' => 'radios',
    '#title' => $this
      ->t('Type'),
    '#options' => [
      'standalone' => $this
        ->t('Standalone'),
      'bootstrap' => $this
        ->t('Bootstrap'),
    ],
    '#default_value' => $this
      ->config('footable.settings')
      ->get('footable_plugin_type'),
  ];
  $form['plugin']['footable_plugin_compression'] = [
    '#type' => 'radios',
    '#title' => $this
      ->t('Compression level'),
    '#options' => [
      'minified' => $this
        ->t('Production (minified)'),
      'source' => $this
        ->t('Development (uncompressed)'),
    ],
    '#default_value' => $this
      ->config('footable.settings')
      ->get('footable_plugin_compression'),
  ];
  return parent::buildForm($form, $form_state);
}