function ContextAwareVariantInterface::setContexts
Same name in other branches
- 9 core/lib/Drupal/Core/Display/ContextAwareVariantInterface.php \Drupal\Core\Display\ContextAwareVariantInterface::setContexts()
- 8.9.x core/lib/Drupal/Core/Display/ContextAwareVariantInterface.php \Drupal\Core\Display\ContextAwareVariantInterface::setContexts()
- 11.x core/lib/Drupal/Core/Display/ContextAwareVariantInterface.php \Drupal\Core\Display\ContextAwareVariantInterface::setContexts()
Sets the context values for this display variant.
Parameters
\Drupal\Component\Plugin\Context\ContextInterface[] $contexts: An array of contexts, keyed by context name.
Return value
$this
1 method overrides ContextAwareVariantInterface::setContexts()
- TestDisplayVariant::setContexts in core/
modules/ system/ tests/ modules/ display_variant_test/ src/ Plugin/ DisplayVariant/ TestDisplayVariant.php - Sets the contexts.
File
-
core/
lib/ Drupal/ Core/ Display/ ContextAwareVariantInterface.php, line 26
Class
- ContextAwareVariantInterface
- Provides an interface for variant plugins that are context-aware.
Namespace
Drupal\Core\DisplayCode
public function setContexts(array $contexts);
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.