You are here

class BlockRenderAlterContent 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
  2. 10 core/modules/block/tests/modules/block_test/src/BlockRenderAlterContent.php \Drupal\block_test\BlockRenderAlterContent

Implements a trusted preRender callback.

Hierarchy

Expanded class hierarchy of BlockRenderAlterContent

File

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

Namespace

Drupal\block_test
View source
class BlockRenderAlterContent implements RenderCallbackInterface {

  /**
   * #pre_render callback for a block to alter its content.
   */
  public static function preRender(array $build) {
    $build['#prefix'] = 'Hiya!<br>';
    return $build;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BlockRenderAlterContent::preRender public static function #pre_render callback for a block to alter its content.