interface ContextAwareVariantInterface in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Display/ContextAwareVariantInterface.php \Drupal\Core\Display\ContextAwareVariantInterface
- 9 core/lib/Drupal/Core/Display/ContextAwareVariantInterface.php \Drupal\Core\Display\ContextAwareVariantInterface
Provides an interface for variant plugins that are context-aware.
Hierarchy
- interface \Drupal\Component\Plugin\PluginInspectionInterface; interface \Drupal\Component\Plugin\ConfigurableInterface; interface \Drupal\Component\Plugin\DependentPluginInterface; interface \Drupal\Core\Plugin\PluginFormInterface; interface \Drupal\Core\Cache\RefinableCacheableDependencyInterface
- interface \Drupal\Core\Display\VariantInterface
- interface \Drupal\Core\Display\ContextAwareVariantInterface
- interface \Drupal\Core\Display\VariantInterface
Expanded class hierarchy of ContextAwareVariantInterface
All classes that implement ContextAwareVariantInterface
2 files declare their use of ContextAwareVariantInterface
- HtmlRenderer.php in core/
lib/ Drupal/ Core/ Render/ MainContent/ HtmlRenderer.php - TestDisplayVariant.php in core/
modules/ system/ tests/ modules/ display_variant_test/ src/ Plugin/ DisplayVariant/ TestDisplayVariant.php
File
- core/
lib/ Drupal/ Core/ Display/ ContextAwareVariantInterface.php, line 8
Namespace
Drupal\Core\DisplayView source
interface ContextAwareVariantInterface extends VariantInterface {
/**
* Gets the values for all defined contexts.
*
* @return \Drupal\Component\Plugin\Context\ContextInterface[]
* An array of set contexts, keyed by context name.
*/
public function getContexts();
/**
* Sets the context values for this display variant.
*
* @param \Drupal\Component\Plugin\Context\ContextInterface[] $contexts
* An array of contexts, keyed by context name.
*
* @return $this
*/
public function setContexts(array $contexts);
}