class 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.