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

VariantBase::__construct

public VariantBase::__construct(array $configuration, $plugin_id, $plugin_definition) Constructs a Drupal\Component\Plugin\PluginBase object. Parameters array $configuration: A configuration array containing information about the plugin instance. string $plugin_id: The plugin_id for the plugin instance. mixed $plugin_definition: The plugin implementation definition. Overrides PluginBase::__construct File core/lib/Drupal/Core/Display/VariantBase.php, line 27 Class VariantBase Provides a ba

VariantBase::setConfiguration

public VariantBase::setConfiguration(array $configuration) Sets the configuration for this plugin instance. Parameters array $configuration: An associative array containing the plugin's configuration. Overrides ConfigurablePluginInterface::setConfiguration File core/lib/Drupal/Core/Display/VariantBase.php, line 80 Class VariantBase Provides a base class for DisplayVariant plugins. Namespace Drupal\Core\Display Code public function setConfiguration(array $configuration) { $this->c

VariantBase::submitConfigurationForm

public VariantBase::submitConfigurationForm(array &$form, FormStateInterface $form_state) Form submission handler. Parameters array $form: An associative array containing the structure of the plugin form as built by static::buildConfigurationForm(). \Drupal\Core\Form\FormStateInterface $form_state: The current state of the form. Calling code should pass on a subform state created through \Drupal\Core\Form\SubformState::createForSubform(). Overrides PluginFormInterface::submitConfigurationF

VariantBase::label

public VariantBase::label() Returns the user-facing display variant label. Return value string The display variant label. Overrides VariantInterface::label File core/lib/Drupal/Core/Display/VariantBase.php, line 36 Class VariantBase Provides a base class for DisplayVariant plugins. Namespace Drupal\Core\Display Code public function label() { return $this->configuration['label']; }

VariantBase::id

public VariantBase::id() Returns the unique ID for the display variant. Return value string The display variant ID. Overrides VariantInterface::id File core/lib/Drupal/Core/Display/VariantBase.php, line 50 Class VariantBase Provides a base class for DisplayVariant plugins. Namespace Drupal\Core\Display Code public function id() { return $this->configuration['uuid']; }

VariantBase::setWeight

public VariantBase::setWeight($weight) Sets the weight of the display variant. Parameters int $weight: The weight to set. Overrides VariantInterface::setWeight File core/lib/Drupal/Core/Display/VariantBase.php, line 64 Class VariantBase Provides a base class for DisplayVariant plugins. Namespace Drupal\Core\Display Code public function setWeight($weight) { $this->configuration['weight'] = (int) $weight; }

VariantBase::getWeight

public VariantBase::getWeight() Returns the weight of the display variant. Return value int The display variant weight. Overrides VariantInterface::getWeight File core/lib/Drupal/Core/Display/VariantBase.php, line 57 Class VariantBase Provides a base class for DisplayVariant plugins. Namespace Drupal\Core\Display Code public function getWeight() { return (int) $this->configuration['weight']; }

VariantBase::adminLabel

public VariantBase::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. Overrides VariantInterface::adminLabel File core/lib/Drupal/Core/Display/VariantBase.php, line 43 Class VariantBase Provides a base class for DisplayVariant plugins. Namespace Drupal\Core\Display Code public function adminLabel() { return $this->pluginDefinition['a

VariantBase::getConfiguration

public VariantBase::getConfiguration() Gets this plugin's configuration. Return value array An array of this plugin's configuration. Overrides ConfigurablePluginInterface::getConfiguration File core/lib/Drupal/Core/Display/VariantBase.php, line 71 Class VariantBase Provides a base class for DisplayVariant plugins. Namespace Drupal\Core\Display Code public function getConfiguration() { return array( 'id' => $this->getPluginId(), ) + $this->configuration; }