You are here

public static function BlockRenderAlterContent::preRender in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/block/tests/modules/block_test/src/BlockRenderAlterContent.php \Drupal\block_test\BlockRenderAlterContent::preRender()
  2. 10 core/modules/block/tests/modules/block_test/src/BlockRenderAlterContent.php \Drupal\block_test\BlockRenderAlterContent::preRender()

#pre_render callback for a block to alter its content.

File

core/modules/block/tests/modules/block_test/src/BlockRenderAlterContent.php, line 15

Class

BlockRenderAlterContent
Implements a trusted preRender callback.

Namespace

Drupal\block_test

Code

public static function preRender(array $build) {
  $build['#prefix'] = 'Hiya!<br>';
  return $build;
}