function block_test_block_view_test_cache_alter in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/block/tests/modules/block_test/block_test.module \block_test_block_view_test_cache_alter()
Implements hook_block_view_BASE_BLOCK_ID_alter().
File
- core/
modules/ block/ tests/ modules/ block_test/ block_test.module, line 23 - Provide test blocks.
Code
function block_test_block_view_test_cache_alter(array &$build, BlockPluginInterface $block) {
if (\Drupal::state()
->get('block_test_view_alter_suffix') !== NULL) {
$build['#attributes']['foo'] = 'bar';
}
if (\Drupal::state()
->get('block_test_view_alter_append_pre_render_prefix') !== NULL) {
$build['#pre_render'][] = 'block_test_pre_render_alter_content';
}
}