You are here

public function ModernizrSettingsForm::buildForm in Modernizr 8

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

lib/Drupal/modernizr/Form/ModernizrSettingsForm.php, line 27
Modernizr admin settings.

Class

ModernizrSettingsForm
Defines a form to configure module settings.

Namespace

Drupal\modernizr\Form

Code

public function buildForm(array $form, array &$form_state) {
  $settings = $this
    ->config('modernizr_settings');
  $form['modernizr_scope'] = array(
    '#type' => 'select',
    '#options' => array(
      'header' => $this
        ->t('header'),
      'footer' => $this
        ->t('footer'),
    ),
    '#default_value' => $settings
      ->get('modernizr_scope'),
  );
  return parent::buildForm($form, $form_state);
}