Issue #2828372 by Sut3kh: Mistake in hook_block_build_alter example

8.3.x
xjm 2016-11-19 12:12:26 -06:00
parent 8766c9970f
commit 7b1b981b1a
1 changed files with 1 additions and 1 deletions

View File

@ -151,7 +151,7 @@ function hook_block_view_BASE_BLOCK_ID_alter(array &$build, \Drupal\Core\Block\B
function hook_block_build_alter(array &$build, \Drupal\Core\Block\BlockPluginInterface $block) {
// Add the 'user' cache context to some blocks.
if ($some_condition) {
$build['#contexts'][] = 'user';
$build['#cache']['contexts'][] = 'user';
}
}