You are here

public function SettingsForm::buildForm in Minify JS 8.2

Same name and namespace in other branches
  1. 8 src/Form/SettingsForm.php \Drupal\minifyjs\Form\SettingsForm::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 FormInterface::buildForm

File

src/Form/SettingsForm.php, line 16

Class

SettingsForm
Settings form for the module.

Namespace

Drupal\minifyjs\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form = [];
  $form['disable_admin'] = [
    '#title' => t('Disable on admin pages.'),
    '#description' => t('Disable this module functionality on admin pages.'),
    '#type' => 'checkbox',
    '#default_value' => \Drupal::config('minifyjs.config')
      ->get('disable_admin'),
  ];
  $form['exclusion_list'] = [
    '#title' => t('Exclusion List'),
    '#description' => t('Some files cannot be minified, for whatever reason. This list allows the administrator to exclude these files from the Manage Javascript Files page and stops the site from using the minified version of the file (if applicable). Allows wildcards (*) and other Drupal path conventions.'),
    '#type' => 'textarea',
    '#default_value' => \Drupal::config('minifyjs.config')
      ->get('exclusion_list'),
  ];
  $form['save'] = [
    '#type' => 'submit',
    '#value' => t('Save settings'),
  ];
  return $form;
}