You are here

public function ModuleFilterSettingsForm::buildForm in Module Filter 8.3

Same name and namespace in other branches
  1. 8 src/Form/ModuleFilterSettingsForm.php \Drupal\module_filter\Form\ModuleFilterSettingsForm::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/ModuleFilterSettingsForm.php, line 23

Class

ModuleFilterSettingsForm
Settings form for Module Filter.

Namespace

Drupal\module_filter\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('module_filter.settings');
  $form = parent::buildForm($form, $form_state);
  $form['modules'] = [
    '#type' => 'fieldset',
    '#title' => $this
      ->t('Extend'),
    '#description' => $this
      ->t('These are settings pertaining to the Extend pages of the site.'),
    '#collapsible' => FALSE,
  ];
  $form['modules']['tabs'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Enhance the Extend page with tabs'),
    '#description' => $this
      ->t('Provides many enhancements to the Extend page including the use of tabs for packages.'),
    '#default_value' => $config
      ->get('tabs'),
  ];
  $form['modules']['path'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Show module path in modules list'),
    '#description' => $this
      ->t('Defines if the relative path of each module will be display in its row.'),
    '#default_value' => $config
      ->get('path'),
  ];
  return $form;
}