You are here

public function ContextManager::evaluateContexts in Context 8

Same name and namespace in other branches
  1. 8.4 src/ContextManager.php \Drupal\context\ContextManager::evaluateContexts()
  2. 8.0 src/ContextManager.php \Drupal\context\ContextManager::evaluateContexts()

Evaluate all context conditions.

1 call to ContextManager::evaluateContexts()
ContextManager::getActiveContexts in src/ContextManager.php
Get the evaluated and active contexts.

File

src/ContextManager.php, line 197

Class

ContextManager
This is the manager service for the context module and should not be confused with the built in contexts in Drupal.

Namespace

Drupal\context

Code

public function evaluateContexts() {

  /** @var \Drupal\context\ContextInterface $context */
  foreach ($this
    ->getContexts() as $context) {
    if ($this
      ->evaluateContextConditions($context) && !$context
      ->disabled()) {
      $this->activeContexts[] = $context;
    }
  }
  $this->contextConditionsEvaluated = TRUE;
}