You are here

public function ConfigurationForm::buildForm in Organic Groups Menu (OG 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/ConfigurationForm.php, line 30

Class

ConfigurationForm
Provides the configuration form for OG Menu.

Namespace

Drupal\og_menu\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form = parent::buildForm($form, $form_state);
  $config = $this
    ->config('og_menu.settings');
  $form['autocreate'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Automatically create new menus'),
    '#description' => $this
      ->t('When enabled an OG Menu will automatically be created when new group is created.'),
    '#default_value' => $config
      ->get('autocreate'),
  ];
  return $form;
}