VariantManager::__construct

public VariantManager::__construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) Constructs a new VariantManager. Parameters \Traversable $namespaces: An object that implements \Traversable which contains the root paths keyed by the corresponding namespace to look for plugin implementations. \Drupal\Core\Cache\CacheBackendInterface $cache_backend: Cache backend instance to use. \Drupal\Core\Extension\ModuleHandlerInterface $module_handl

VariantManager

Manages discovery of display variant plugins. Hierarchy class \Drupal\Component\Plugin\PluginManagerBase implements PluginManagerInterface uses DiscoveryTraitclass \Drupal\Core\Plugin\DefaultPluginManager implements CachedDiscoveryInterface, PluginManagerInterface, CacheableDependencyInterface uses DiscoveryCachedTrait, UseCacheBackendTraitclass \Drupal\Core\Display\VariantManager See also \Drupal\Core\Display\Annotation\DisplayVariant \Drupal\Core\Display\VariantInterface \Drupal\Core\Di

VariantInterface::setWeight

public VariantInterface::setWeight($weight) Sets the weight of the display variant. Parameters int $weight: The weight to set. File core/lib/Drupal/Core/Display/VariantInterface.php, line 61 Class VariantInterface Provides an interface for DisplayVariant plugins. Namespace Drupal\Core\Display Code public function setWeight($weight);

VariantInterface::label

public VariantInterface::label() Returns the user-facing display variant label. Return value string The display variant label. File core/lib/Drupal/Core/Display/VariantInterface.php, line 27 Class VariantInterface Provides an interface for DisplayVariant plugins. Namespace Drupal\Core\Display Code public function label();

VariantInterface::id

public VariantInterface::id() Returns the unique ID for the display variant. Return value string The display variant ID. File core/lib/Drupal/Core/Display/VariantInterface.php, line 45 Class VariantInterface Provides an interface for DisplayVariant plugins. Namespace Drupal\Core\Display Code public function id();

VariantInterface::getWeight

public VariantInterface::getWeight() Returns the weight of the display variant. Return value int The display variant weight. File core/lib/Drupal/Core/Display/VariantInterface.php, line 53 Class VariantInterface Provides an interface for DisplayVariant plugins. Namespace Drupal\Core\Display Code public function getWeight();

VariantInterface::build

public VariantInterface::build() Builds and returns the renderable array for the display variant. The variant can contain cacheability metadata for the configuration that was passed in setConfiguration(). In the build() method, this should be added to the render array that is returned. Return value array A render array for the display variant. File core/lib/Drupal/Core/Display/VariantInterface.php, line 85 Class VariantInterface Provides an interface for DisplayVariant plugins. Namespac

VariantInterface::adminLabel

public VariantInterface::adminLabel() Returns the admin-facing display variant label. This is for the type of display variant, not the configured variant itself. Return value string The display variant administrative label. File core/lib/Drupal/Core/Display/VariantInterface.php, line 37 Class VariantInterface Provides an interface for DisplayVariant plugins. Namespace Drupal\Core\Display Code public function adminLabel();

VariantInterface::access

public VariantInterface::access(AccountInterface $account = NULL) Determines if this display variant is accessible. Parameters \Drupal\Core\Session\AccountInterface $account: (optional) The user for which to check access, or NULL to check access for the current user. Defaults to NULL. Return value bool TRUE if this display variant is accessible, FALSE otherwise. File core/lib/Drupal/Core/Display/VariantInterface.php, line 73 Class VariantInterface Provides an interface for DisplayVariant

VariantInterface

Provides an interface for DisplayVariant plugins. Hierarchy interface \Drupal\Component\Plugin\PluginInspectionInterface; interface \Drupal\Component\Plugin\ConfigurablePluginInterface; interface \Drupal\Core\Plugin\PluginFormInterface; interface \Drupal\Core\Cache\RefinableCacheableDependencyInterfaceinterface \Drupal\Core\Display\VariantInterface See also \Drupal\Core\Display\Annotation\DisplayVariant \Drupal\Core\Display\VariantBase \Drupal\Core\Display\VariantManager Plugin API File co