function TestThemeThemeHooks::formSystemThemeSettingsAlter

Implements hook_form_system_theme_settings_alter().

Attributes

#[Hook('form_system_theme_settings_alter')]

File

core/modules/system/tests/themes/test_theme_theme/src/Hook/TestThemeThemeHooks.php, line 28

Class

TestThemeThemeHooks
Hook implementations for test_theme_theme.

Namespace

Drupal\test_theme_theme\Hook

Code

public function formSystemThemeSettingsAlter(&$form, FormStateInterface $form_state) : void {
  $form['custom_logo'] = [
    '#type' => 'managed_file',
    '#title' => $this->t('Secondary logo.'),
    '#default_value' => $this->themeSettingsProvider
      ->getSetting('custom_logo'),
    '#progress_indicator' => 'bar',
    '#progress_message' => $this->t('Processing...'),
    '#upload_location' => 'public://test',
    '#upload_validators' => [
      'FileExtension' => [
        'extensions' => 'gif png jpg jpeg',
      ],
    ],
  ];
  $form['#submit'][] = static::class . ':themeSettingsSubmit';
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.