You are here

public function SettingsForm::buildForm in Advanced CSS/JS Aggregation 8.4

Same name in this branch
  1. 8.4 src/Form/SettingsForm.php \Drupal\advagg\Form\SettingsForm::buildForm()
  2. 8.4 advagg_ext_minify/src/Form/SettingsForm.php \Drupal\advagg_ext_minify\Form\SettingsForm::buildForm()
  3. 8.4 advagg_old_ie_compatibility/src/Form/SettingsForm.php \Drupal\advagg_old_ie_compatibility\Form\SettingsForm::buildForm()
  4. 8.4 advagg_mod/src/Form/SettingsForm.php \Drupal\advagg_mod\Form\SettingsForm::buildForm()
  5. 8.4 advagg_css_minify/src/Form/SettingsForm.php \Drupal\advagg_css_minify\Form\SettingsForm::buildForm()
  6. 8.4 advagg_js_minify/src/Form/SettingsForm.php \Drupal\advagg_js_minify\Form\SettingsForm::buildForm()
  7. 8.4 advagg_cdn/src/Form/SettingsForm.php \Drupal\advagg_cdn\Form\SettingsForm::buildForm()
  8. 8.4 advagg_bundler/src/Form/SettingsForm.php \Drupal\advagg_bundler\Form\SettingsForm::buildForm()
Same name and namespace in other branches
  1. 8.3 advagg_old_ie_compatibility/src/Form/SettingsForm.php \Drupal\advagg_old_ie_compatibility\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 ConfigFormBase::buildForm

File

advagg_old_ie_compatibility/src/Form/SettingsForm.php, line 69

Class

SettingsForm
Configure advagg ie compatibility for this site.

Namespace

Drupal\advagg_old_ie_compatibility\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('advagg_old_ie_compatibility.settings');
  $form['active'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Prevent more than %limit CSS selectors in an aggregated CSS file', [
      '%limit' => $config
        ->get('limit'),
    ]),
    '#default_value' => $config
      ->get('active'),
    '#description' => $this
      ->t('Internet Explorer before version 10; IE9, IE8, IE7, and IE6 all have 4095 as the limit for the maximum number of css selectors that can be in a file. Enabling this will prevent CSS aggregates from being created that exceed this limit. <a href="@link">More info</a>.', [
      '@link' => 'http://blogs.msdn.com/b/ieinternals/archive/2011/05/14/10164546.aspx',
    ]),
  ];
  $form['limit'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('The selector count the IE CSS limiter should use'),
    '#default_value' => $config
      ->get('limit'),
    '#description' => $this
      ->t('Internet Explorer before version 10; IE9, IE8, IE7, and IE6 all have 4095 as the limit for the maximum number of css selectors that can be in a file. Use this field to modify the value used.'),
    '#states' => [
      'visible' => [
        '#edit-active' => [
          'checked' => TRUE,
        ],
      ],
      'disabled' => [
        '#edit-active' => [
          'checked' => FALSE,
        ],
      ],
    ],
  ];
  return parent::buildForm($form, $form_state);
}