LayoutBuilderTestPlugin.php
Same filename in other branches
- 8.9.x core/modules/layout_builder/tests/modules/layout_builder_test/src/Plugin/Layout/LayoutBuilderTestPlugin.php
- 10 core/modules/layout_builder/tests/modules/layout_builder_test/src/Plugin/Layout/LayoutBuilderTestPlugin.php
- 11.x core/modules/layout_builder/tests/modules/layout_builder_test/src/Plugin/Layout/LayoutBuilderTestPlugin.php
Namespace
Drupal\layout_builder_test\Plugin\LayoutFile
-
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;
/**
* @Layout(
* id = "layout_builder_test_plugin",
* label = @Translation("Layout Builder Test Plugin"),
* regions = {
* "main" = {
* "label" = @Translation("Main Region")
* }
* },
* )
*/
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;
}
}
Classes
Title | Deprecated | Summary |
---|---|---|
LayoutBuilderTestPlugin | Plugin annotation @Layout( id = "layout_builder_test_plugin", label = @Translation("Layout Builder Test Plugin"), regions = { "main" = { "label" = @Translation("Main Region") } }, ) |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.