You are here

public function SystemThemeSettings::alterFormElement in Express 8

The alter method to store the code.

Parameters

\Drupal\bootstrap\Utility\Element $form: The Element object that comprises the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

string $form_id: String representing the name of the form itself. Typically this is the name of the function that generated the form.

Overrides FormBase::alterFormElement

File

themes/contrib/bootstrap/src/Plugin/Form/SystemThemeSettings.php, line 27
Contains \Drupal\bootstrap\Plugin\Form\SystemThemeSettings.

Class

SystemThemeSettings
Implements hook_form_system_theme_settings_alter().

Namespace

Drupal\bootstrap\Plugin\Form

Code

public function alterFormElement(Element $form, FormStateInterface $form_state, $form_id = NULL) {
  $theme = $this
    ->getTheme($form, $form_state);
  if (!$theme) {
    return;
  }

  // Creates the necessary groups (vertical tabs) for a Bootstrap based theme.
  $this
    ->createGroups($form, $form_state);

  // Iterate over all setting plugins and add them to the form.
  foreach ($theme
    ->getSettingPlugin() as $setting) {
    $setting
      ->alterForm($form
      ->getArray(), $form_state);
  }
}