You are here

public function GroupMenuSettingsForm::buildForm in Group Menu 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

src/Form/GroupMenuSettingsForm.php, line 30

Class

GroupMenuSettingsForm
Class GroupMenuSettingsForm.

Namespace

Drupal\groupmenu\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form = parent::buildForm($form, $form_state);
  $config = $this
    ->config('groupmenu.settings');
  $form['groupmenu_hide_list'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Hide group menus from menu lists'),
    '#description' => $this
      ->t("Hide group menus from default menu lists. (recommended)"),
    '#default_value' => $config
      ->get('groupmenu_hide_list'),
  ];
  return $form;
}