You are here

public function SettingsForm::buildForm in FullCalendar 8.3

Same name in this branch
  1. 8.3 src/Form/SettingsForm.php \Drupal\fullcalendar\Form\SettingsForm::buildForm()
  2. 8.3 fullcalendar_options/src/Form/SettingsForm.php \Drupal\fullcalendar_options\Form\SettingsForm::buildForm()
Same name and namespace in other branches
  1. 8.5 src/Form/SettingsForm.php \Drupal\fullcalendar\Form\SettingsForm::buildForm()
  2. 8 src/Form/SettingsForm.php \Drupal\fullcalendar\Form\SettingsForm::buildForm()
  3. 8.2 src/Form/SettingsForm.php \Drupal\fullcalendar\Form\SettingsForm::buildForm()
  4. 8.4 src/Form/SettingsForm.php \Drupal\fullcalendar\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
@todo.

Namespace

Drupal\fullcalendar\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('fullcalendar.settings');
  $form['path'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Path to FullCalendar'),
    '#default_value' => $config
      ->get('path'),
    '#description' => $this
      ->t('Enter the path relative to Drupal root where the FullCalendar plugin directory is located.'),
  ];
  $form['compression'] = [
    '#type' => 'radios',
    '#title' => $this
      ->t('Choose FullCalendar compression level'),
    '#options' => [
      'min' => $this
        ->t('Production (Minified)'),
      'none' => $this
        ->t('Development (Uncompressed code)'),
    ],
    '#default_value' => $config
      ->get('compression'),
  ];
  return parent::buildForm($form, $form_state);
}