Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ContextAwareVariantInterface.php

interface ContextAwareVariantInterface

Provides an interface for variant plugins that are context-aware.

Hierarchy

  • interface \Drupal\Component\Plugin\ConfigurableInterface; interface \Drupal\Component\Plugin\DependentPluginInterface; interface \Drupal\Component\Plugin\PluginInspectionInterface; interface \Drupal\Core\Cache\RefinableCacheableDependencyInterface extends \Drupal\Core\Cache\CacheableDependencyInterface; interface \Drupal\Core\Plugin\PluginFormInterface
    • interface \Drupal\Core\Display\VariantInterface extends \Drupal\Component\Plugin\PluginInspectionInterface \Drupal\Component\Plugin\ConfigurableInterface \Drupal\Component\Plugin\DependentPluginInterface \Drupal\Core\Plugin\PluginFormInterface \Drupal\Core\Cache\RefinableCacheableDependencyInterface
      • interface \Drupal\Core\Display\ContextAwareVariantInterface extends \Drupal\Core\Display\VariantInterface

Expanded class hierarchy of ContextAwareVariantInterface

All classes that implement ContextAwareVariantInterface

1 file declares its use of ContextAwareVariantInterface
HtmlRenderer.php in core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php

File

core/lib/Drupal/Core/Display/ContextAwareVariantInterface.php, line 8

Namespace

Drupal\Core\Display
View 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);

}

Members

Title Sort descending Modifiers Object type Summary Overrides
CacheableDependencyInterface::getCacheContexts public function The cache contexts associated with this object. 30
CacheableDependencyInterface::getCacheMaxAge public function The maximum age for which this object may be cached. 30
CacheableDependencyInterface::getCacheTags public function The cache tags associated with this object. 23
ConfigurableInterface::defaultConfiguration public function Gets default configuration for this plugin. 10
ConfigurableInterface::getConfiguration public function Gets this plugin's configuration. 10
ConfigurableInterface::setConfiguration public function Sets the configuration for this plugin instance. 10
ContextAwareVariantInterface::getContexts public function Gets the values for all defined contexts.
ContextAwareVariantInterface::setContexts public function Sets the context values for this display variant.
DependentPluginInterface::calculateDependencies public function Calculates dependencies for the configured plugin. 18
PluginFormInterface::buildConfigurationForm public function Form constructor. 20
PluginFormInterface::submitConfigurationForm public function Form submission handler. 20
PluginFormInterface::validateConfigurationForm public function Form validation handler. 15
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 5
PluginInspectionInterface::getPluginId public function Gets the plugin ID of the plugin instance. 2
RefinableCacheableDependencyInterface::addCacheableDependency public function Adds a dependency on an object: merges its cacheability metadata. 1
RefinableCacheableDependencyInterface::addCacheContexts public function Adds cache contexts. 1
RefinableCacheableDependencyInterface::addCacheTags public function Adds cache tags. 1
RefinableCacheableDependencyInterface::mergeCacheMaxAge public function Merges the maximum age (in seconds) with the existing maximum age. 1
VariantInterface::access public function Determines if this display variant is accessible. 1
VariantInterface::adminLabel public function Returns the admin-facing display variant label. 1
VariantInterface::build public function Builds and returns the renderable array for the display variant. 2
VariantInterface::getWeight public function Returns the weight of the display variant. 1
VariantInterface::id public function Returns the unique ID for the display variant. 1
VariantInterface::label public function Returns the user-facing display variant label. 1
VariantInterface::setWeight public function Sets the weight of the display variant. 1

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal