function TestDisplayVariant::setMainContent
Same name in other branches
- 9 core/modules/system/tests/modules/display_variant_test/src/Plugin/DisplayVariant/TestDisplayVariant.php \Drupal\display_variant_test\Plugin\DisplayVariant\TestDisplayVariant::setMainContent()
- 8.9.x core/modules/system/tests/modules/display_variant_test/src/Plugin/DisplayVariant/TestDisplayVariant.php \Drupal\display_variant_test\Plugin\DisplayVariant\TestDisplayVariant::setMainContent()
- 11.x core/modules/system/tests/modules/display_variant_test/src/Plugin/DisplayVariant/TestDisplayVariant.php \Drupal\display_variant_test\Plugin\DisplayVariant\TestDisplayVariant::setMainContent()
Overrides PageVariantInterface::setMainContent
File
-
core/
modules/ system/ tests/ modules/ display_variant_test/ src/ Plugin/ DisplayVariant/ TestDisplayVariant.php, line 70
Class
- TestDisplayVariant
- Provides a display variant that requires configuration.
Namespace
Drupal\display_variant_test\Plugin\DisplayVariantCode
public function setMainContent(array $main_content) {
assert(!empty($this->getConfiguration()['required_configuration']), 'Ensure that ::setMainContent() is called with the variant configuration');
$this->mainContent = $main_content;
return $this;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.