Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. CurrentThemeCondition.php

function CurrentThemeCondition::buildConfigurationForm

Overrides ConditionPluginBase::buildConfigurationForm

File

core/modules/system/src/Plugin/Condition/CurrentThemeCondition.php, line 80

Class

CurrentThemeCondition
Provides a 'Current Theme' condition.

Namespace

Drupal\system\Plugin\Condition

Code

public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
    $form['theme'] = [
        '#type' => 'select',
        '#title' => $this->t('Theme'),
        '#default_value' => $this->configuration['theme'],
        '#options' => array_map(function ($theme_info) {
            return $theme_info->info['name'];
        }, $this->themeHandler
            ->listInfo()),
    ];
    return parent::buildConfigurationForm($form, $form_state);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal