class BlockRenderAlterContent
Same name in other branches
- 8.9.x core/modules/block/tests/modules/block_test/src/BlockRenderAlterContent.php \Drupal\block_test\BlockRenderAlterContent
- 10 core/modules/block/tests/modules/block_test/src/BlockRenderAlterContent.php \Drupal\block_test\BlockRenderAlterContent
- 11.x core/modules/block/tests/modules/block_test/src/BlockRenderAlterContent.php \Drupal\block_test\BlockRenderAlterContent
Implements a trusted preRender callback.
Hierarchy
- class \Drupal\block_test\BlockRenderAlterContent implements \Drupal\Core\Render\Element\RenderCallbackInterface
Expanded class hierarchy of BlockRenderAlterContent
File
-
core/
modules/ block/ tests/ modules/ block_test/ src/ BlockRenderAlterContent.php, line 10
Namespace
Drupal\block_testView 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.