You are here

public function CurrentThemeCondition::evaluate in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/system/src/Plugin/Condition/CurrentThemeCondition.php \Drupal\system\Plugin\Condition\CurrentThemeCondition::evaluate()

Evaluates the condition and returns TRUE or FALSE accordingly.

Return value

bool TRUE if the condition has been met, FALSE otherwise.

Overrides ConditionInterface::evaluate

File

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

Class

CurrentThemeCondition
Provides a 'Current Theme' condition.

Namespace

Drupal\system\Plugin\Condition

Code

public function evaluate() {
  if (!$this->configuration['theme']) {
    return TRUE;
  }
  return $this->themeManager
    ->getActiveTheme()
    ->getName() == $this->configuration['theme'];
}