You are here

public function FollowTagBlock::build in Open Social 10.0.x

Same name and namespace in other branches
  1. 10.3.x modules/social_features/social_follow_taxonomy/modules/social_follow_tag/src/Plugin/Block/FollowTagBlock.php \Drupal\social_follow_tag\Plugin\Block\FollowTagBlock::build()
  2. 10.1.x modules/social_features/social_follow_taxonomy/modules/social_follow_tag/src/Plugin/Block/FollowTagBlock.php \Drupal\social_follow_tag\Plugin\Block\FollowTagBlock::build()
  3. 10.2.x modules/social_features/social_follow_taxonomy/modules/social_follow_tag/src/Plugin/Block/FollowTagBlock.php \Drupal\social_follow_tag\Plugin\Block\FollowTagBlock::build()

Builds and returns the renderable array for this block plugin.

If a block should not be rendered because it has no content, then this method must also ensure to return no content: it must then only return an empty array, or an empty array with #cache set (with cacheability metadata indicating the circumstances for it being empty).

Return value

array A renderable array representing the content of the block.

Overrides BlockPluginInterface::build

See also

\Drupal\block\BlockViewBuilder

File

modules/social_features/social_follow_taxonomy/modules/social_follow_tag/src/Plugin/Block/FollowTagBlock.php, line 59

Class

FollowTagBlock
Provides a 'FollowTagBlock' block.

Namespace

Drupal\social_follow_tag\Plugin\Block

Code

public function build() {
  $build = [];
  $build['content'] = [
    '#lazy_builder' => [
      'social_follow_tag.lazy_builder:lazyBuild',
      [],
    ],
    '#create_placeholder' => TRUE,
  ];
  return $build;
}