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

Breadcrumb

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

function Language::evaluate

Overrides ConditionInterface::evaluate

File

core/modules/language/src/Plugin/Condition/Language.php, line 138

Class

Language
Provides a 'Language' condition.

Namespace

Drupal\language\Plugin\Condition

Code

public function evaluate() {
    if (empty($this->configuration['langcodes']) && !$this->isNegated()) {
        return TRUE;
    }
    $language = $this->getContextValue('language');
    // Language visibility settings.
    return !empty($this->configuration['langcodes'][$language->getId()]);
}

API Navigation

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