You are here

public function ModulesWeightAdminSettings::buildForm in Modules weight 8

Same name and namespace in other branches
  1. 8.2 src/Form/ModulesWeightAdminSettings.php \Drupal\modules_weight\Form\ModulesWeightAdminSettings::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/ModulesWeightAdminSettings.php, line 32

Class

ModulesWeightAdminSettings
Class ModulesWeightAdminSettings.

Namespace

Drupal\modules_weight\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('modules_weight.settings');
  $form['show_system_modules'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Show system modules'),
    '#description' => $this
      ->t("Cautions: This module just display non-core modules by default, if you check this option you will be able to change the core modules weight and as you might notice, all core modules has 0 as weight value by default."),
    '#default_value' => $config
      ->get('show_system_modules'),
  ];
  return parent::buildForm($form, $form_state);
}