You are here

public function SocialGroupTagsBlock::build in Open Social 8.6

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_tagging/src/Plugin/Block/SocialGroupTagsBlock.php \Drupal\social_tagging\Plugin\Block\SocialGroupTagsBlock::build()
  2. 8.4 modules/social_features/social_tagging/src/Plugin/Block/SocialGroupTagsBlock.php \Drupal\social_tagging\Plugin\Block\SocialGroupTagsBlock::build()
  3. 8.5 modules/social_features/social_tagging/src/Plugin/Block/SocialGroupTagsBlock.php \Drupal\social_tagging\Plugin\Block\SocialGroupTagsBlock::build()
  4. 8.7 modules/social_features/social_tagging/src/Plugin/Block/SocialGroupTagsBlock.php \Drupal\social_tagging\Plugin\Block\SocialGroupTagsBlock::build()
  5. 8.8 modules/social_features/social_tagging/src/Plugin/Block/SocialGroupTagsBlock.php \Drupal\social_tagging\Plugin\Block\SocialGroupTagsBlock::build()
  6. 10.3.x modules/social_features/social_tagging/src/Plugin/Block/SocialGroupTagsBlock.php \Drupal\social_tagging\Plugin\Block\SocialGroupTagsBlock::build()
  7. 10.0.x modules/social_features/social_tagging/src/Plugin/Block/SocialGroupTagsBlock.php \Drupal\social_tagging\Plugin\Block\SocialGroupTagsBlock::build()
  8. 10.1.x modules/social_features/social_tagging/src/Plugin/Block/SocialGroupTagsBlock.php \Drupal\social_tagging\Plugin\Block\SocialGroupTagsBlock::build()
  9. 10.2.x modules/social_features/social_tagging/src/Plugin/Block/SocialGroupTagsBlock.php \Drupal\social_tagging\Plugin\Block\SocialGroupTagsBlock::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_tagging/src/Plugin/Block/SocialGroupTagsBlock.php, line 145

Class

SocialGroupTagsBlock
Provides a 'SocialGroupTags' block.

Namespace

Drupal\social_tagging\Plugin\Block

Code

public function build() {
  $build = [];
  $group = $this->routeMatch
    ->getParameter('group');
  if ($group instanceof GroupInterface) {
    $build['content']['#markup'] = social_tagging_process_tags($group);
  }
  return $build;
}