class TestHtmlBlock

Same name in other branches
  1. 9 core/modules/block/tests/modules/block_test/src/Plugin/Block/TestHtmlBlock.php \Drupal\block_test\Plugin\Block\TestHtmlBlock
  2. 10 core/modules/block/tests/modules/block_test/src/Plugin/Block/TestHtmlBlock.php \Drupal\block_test\Plugin\Block\TestHtmlBlock
  3. 11.x core/modules/block/tests/modules/block_test/src/Plugin/Block/TestHtmlBlock.php \Drupal\block_test\Plugin\Block\TestHtmlBlock

Provides a block to test HTML.

Plugin annotation


@Block(
  id = "test_html",
  admin_label = @Translation("Test HTML block")
)

Hierarchy

Expanded class hierarchy of TestHtmlBlock

1 file declares its use of TestHtmlBlock
BlockStorageUnitTest.php in core/modules/block/tests/src/Kernel/BlockStorageUnitTest.php

File

core/modules/block/tests/modules/block_test/src/Plugin/Block/TestHtmlBlock.php, line 15

Namespace

Drupal\block_test\Plugin\Block
View source
class TestHtmlBlock extends BlockBase {
    
    /**
     * {@inheritdoc}
     */
    public function build() {
        return [
            '#attributes' => \Drupal::state()->get('block_test.attributes'),
            '#children' => \Drupal::state()->get('block_test.content'),
        ];
    }

}

Members

Title Sort descending Modifiers Object type Summary
TestHtmlBlock::build public function

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.