function public static function SystemThemeSettings::validateFormElement

8.x-3.x SystemThemeSettings.php public static SystemThemeSettings::validateFormElement(Element $form, FormStateInterface $form_state)

Form validation handler.

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.

Overrides FormBase::validateFormElement

Class

SystemThemeSettings
Implements hook_form_system_theme_settings_alter().

Namespace

Drupal\bootstrap\Plugin\Form

Source src/Plugin/Form/SystemThemeSettings.php (line 255)

public static function validateFormElement(Element $form, FormStateInterface $form_state) {
  $theme = self::getTheme($form, $form_state);
  if (!$theme) {
    return;
  }

  // Iterate over all setting plugins and allow them to participate.
  foreach ($theme->getSettingPlugin() as $setting) {
    // Allow the setting to participate in the form validation process.
    // Must call the "validateForm" method in case any setting actually uses
    // it. It should, in turn, invoke "validateFormElement", if the setting
    // that overrides it is implemented properly.
    $setting->validateForm($form->getArray(), $form_state);
  }
}