You are here

public function MenuSelectConfigForm::buildForm in Menu Select 8

Same name and namespace in other branches
  1. 2.0.x src/Form/MenuSelectConfigForm.php \Drupal\menu_select\Form\MenuSelectConfigForm::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/MenuSelectConfigForm.php, line 51

Class

MenuSelectConfigForm
Controller for Menu Select config form.

Namespace

Drupal\menu_select\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this->configFactory
    ->get('menu_select.settings');
  $form['menu_select_search_enabled'] = [
    '#title' => $this
      ->t('Enable searching for a menu link'),
    '#description' => $this
      ->t('Allows users with "Use menu select search" permission to search for a menu link by name.'),
    '#type' => 'checkbox',
    '#default_value' => $config
      ->get('search_enabled'),
  ];
  return parent::buildForm($form, $form_state);
}