You are here

public function ContextAwareVariantInterface::setContexts in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Display/ContextAwareVariantInterface.php \Drupal\Core\Display\ContextAwareVariantInterface::setContexts()
  2. 9 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\Display

Code

public function setContexts(array $contexts);