function BlockRenderAlterContent::preRender

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. 8.9.x core/modules/block/tests/modules/block_test/src/BlockRenderAlterContent.php \Drupal\block_test\BlockRenderAlterContent::preRender()
  3. 11.x 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;
}

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