public function ContextManager::evaluateContexts in Context 8
Same name and namespace in other branches
- 8.4 src/ContextManager.php \Drupal\context\ContextManager::evaluateContexts()
- 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\contextCode
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;
}