class BlockRenderAlterContent

Same name and namespace in other branches
  1. 9 core/modules/block/tests/modules/block_test/src/BlockRenderAlterContent.php \Drupal\block_test\BlockRenderAlterContent
  2. 8.9.x core/modules/block/tests/modules/block_test/src/BlockRenderAlterContent.php \Drupal\block_test\BlockRenderAlterContent
  3. 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 12

Namespace

Drupal\block_test
View source
class BlockRenderAlterContent implements RenderCallbackInterface {
  
  /**
   * Render API callback: Alters the content of a block.
   *
   * This function is assigned as a #pre_render callback.
   */
  public static function preRender(array $build) {
    $build['#prefix'] = 'Hiya!<br>';
    return $build;
  }

}

Members

Title Sort descending Modifiers Object type Summary
BlockRenderAlterContent::preRender public static function Render API callback: Alters the content of a block.

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