class LayoutBuilderTestPlugin in Drupal 10
Same name and namespace in other branches
- 8 core/modules/layout_builder/tests/modules/layout_builder_test/src/Plugin/Layout/LayoutBuilderTestPlugin.php \Drupal\layout_builder_test\Plugin\Layout\LayoutBuilderTestPlugin
- 9 core/modules/layout_builder/tests/modules/layout_builder_test/src/Plugin/Layout/LayoutBuilderTestPlugin.php \Drupal\layout_builder_test\Plugin\Layout\LayoutBuilderTestPlugin
Plugin annotation
@Layout(
id = "layout_builder_test_plugin",
label = @Translation("Layout Builder Test Plugin"),
regions = {
"main" = {
"label" = @Translation("Main Region")
}
},
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
- class \Drupal\Core\Layout\LayoutDefault implements LayoutInterface, PluginFormInterface, PreviewAwarePluginInterface uses ContextAwarePluginAssignmentTrait, ContextAwarePluginTrait
- class \Drupal\layout_builder_test\Plugin\Layout\LayoutBuilderTestPlugin
- class \Drupal\Core\Layout\LayoutDefault implements LayoutInterface, PluginFormInterface, PreviewAwarePluginInterface uses ContextAwarePluginAssignmentTrait, ContextAwarePluginTrait
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
Expanded class hierarchy of LayoutBuilderTestPlugin
File
- core/
modules/ layout_builder/ tests/ modules/ layout_builder_test/ src/ Plugin/ Layout/ LayoutBuilderTestPlugin.php, line 18
Namespace
Drupal\layout_builder_test\Plugin\LayoutView source
class LayoutBuilderTestPlugin extends LayoutDefault {
/**
* {@inheritdoc}
*/
public function build(array $regions) {
$build = parent::build($regions);
$build['main']['#attributes']['class'][] = 'go-birds';
if ($this->inPreview) {
$build['main']['#attributes']['class'][] = 'go-birds-preview';
}
return $build;
}
}