BlockRenderAlterContent.php
Same filename in other branches
Namespace
Drupal\block_testFile
-
core/
modules/ block/ tests/ modules/ block_test/ src/ BlockRenderAlterContent.php
View 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
Title | Deprecated | Summary |
---|---|---|
BlockRenderAlterContent | Implements a trusted preRender callback. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.