LayoutBuilderTestPlugin.php in Drupal 10
File
core/modules/layout_builder/tests/modules/layout_builder_test/src/Plugin/Layout/LayoutBuilderTestPlugin.php
View source
<?php
namespace Drupal\layout_builder_test\Plugin\Layout;
use Drupal\Core\Layout\LayoutDefault;
class LayoutBuilderTestPlugin extends LayoutDefault {
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;
}
}
Classes
Name |
Description |
LayoutBuilderTestPlugin |
Plugin annotation
@Layout(
id = "layout_builder_test_plugin",
label = @Translation("Layout Builder Test Plugin"),
regions = {
"main" = {
"label" = @Translation("Main Region")
}
},
) |