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::validateConfigurationForm

public VariantBase::validateConfigurationForm(array &$form, FormStateInterface $form_state) Form validation 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::validateConfigurat

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::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::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::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::buildConfigurationForm

public VariantBase::buildConfigurationForm(array $form, FormStateInterface $form_state) Form constructor. Plugin forms are embedded in other forms. In order to know where the plugin form is located in the parent form, #parents and #array_parents must be known, but these are not available during the initial build phase. In order to have these properties available when building the plugin form's elements, let this method return a form element that has a #process callback and build the rest of the

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