You are here

BlockRenderAlterContent.php in Drupal 8

Namespace

Drupal\block_test

File

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

Namesort descending Description
BlockRenderAlterContent Implements a trusted preRender callback.