public function CurrentThemeCondition::evaluate in Drupal 9
Same name and namespace in other branches
- 8 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\ConditionCode
public function evaluate() {
if (!$this->configuration['theme']) {
return TRUE;
}
return $this->themeManager
->getActiveTheme()
->getName() == $this->configuration['theme'];
}