class BlockRenderAlterContent

Same name 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 {
    
    /**
     * #pre_render callback for a block to alter its content.
     */
    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 #pre_render callback for a block to alter its content.

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