BlockRenderAlterContent.php in Drupal 9
Same filename and directory in other branches
Namespace
Drupal\block_testFile
core/modules/block/tests/modules/block_test/src/BlockRenderAlterContent.phpView source
<?php
namespace Drupal\block_test;
use Drupal\Core\Render\Element\RenderCallbackInterface;
/**
* Implements a trusted preRender callback.
*/
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;
}
}
Classes
Name![]() |
Description |
---|---|
BlockRenderAlterContent | Implements a trusted preRender callback. |