You are here

public function BootstrapSiteAlertConfig::buildForm in Bootstrap Site Alert 8.2

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/BootstrapSiteAlertConfig.php, line 32

Class

BootstrapSiteAlertConfig
Class BootstrapSiteAlertConfig.

Namespace

Drupal\bootstrap_site_alert\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('bootstrap_site_alert.config');

  // Set our Bootstrap version.
  $form['bootstrap_site_alert_version'] = [
    '#type' => 'select',
    '#title' => $this
      ->t('Select Bootstrap Version'),
    '#options' => [
      '3' => $this
        ->t('3'),
      '4' => $this
        ->t('4'),
      '5' => $this
        ->t('5'),
    ],
    '#empty_option' => $this
      ->t('- SELECT -'),
    '#required' => TRUE,
    '#default_value' => $config
      ->get('bootstrap_site_alert_version'),
  ];
  return parent::buildForm($form, $form_state);
}