class BlockRenderAlterContent in Drupal 9
Same name and namespace in other branches
- 8 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 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BlockRenderAlterContent:: |
public static | function | #pre_render callback for a block to alter its content. |