public function TestCacheBlock::build

Builds and returns the renderable array for this block plugin.

Return value

array A renderable array representing the content of the block.

Overrides BlockPluginInterface::build

See also

\Drupal\block\BlockRenderController

File

drupal/core/modules/block/tests/lib/Drupal/block_test/Plugin/Block/TestCacheBlock.php, line 39
Contains \Drupal\block_test\Plugin\Block\TestCacheBlock.

Class

TestCacheBlock
Provides a block to test caching.

Namespace

Drupal\block_test\Plugin\Block

Code

public function build() {
  return array(
    '#children' => \Drupal::state()
      ->get('block_test.content'),
  );
}