public function ContextAwareVariantInterface::setContexts in Drupal 9
Same name and namespace in other branches
- 8 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);