You are here

public function FooTableConfigForm::buildForm in FooTable 8.2

Same name and namespace in other branches
  1. 8 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) {
  $config = $this
    ->config('footable.settings');
  $form['config'] = [
    '#type' => 'vertical_tabs',
    '#default_tab' => 'edit-plugin',
  ];
  $form['plugin'] = [
    '#type' => 'details',
    '#title' => $this
      ->t('Plugin'),
    '#group' => 'config',
  ];
  $form['plugin']['plugin_type'] = [
    '#type' => 'radios',
    '#title' => $this
      ->t('Type'),
    '#options' => [
      'standalone' => $this
        ->t('Standalone'),
      'bootstrap' => $this
        ->t('Bootstrap'),
    ],
    '#default_value' => $config
      ->get('plugin_type'),
  ];
  $form['plugin']['plugin_compression'] = [
    '#type' => 'radios',
    '#title' => $this
      ->t('Compression level'),
    '#options' => [
      'minified' => $this
        ->t('Production (minified)'),
      'source' => $this
        ->t('Development (uncompressed)'),
    ],
    '#default_value' => $config
      ->get('plugin_compression'),
  ];
  return parent::buildForm($form, $form_state);
}