public function SocialFollowTagLazyBuilder::popupLazyBuild in Open Social 10.3.x
Same name and namespace in other branches
- 10.0.x modules/social_features/social_follow_taxonomy/modules/social_follow_tag/src/SocialFollowTagLazyBuilder.php \Drupal\social_follow_tag\SocialFollowTagLazyBuilder::popupLazyBuild()
- 10.1.x modules/social_features/social_follow_taxonomy/modules/social_follow_tag/src/SocialFollowTagLazyBuilder.php \Drupal\social_follow_tag\SocialFollowTagLazyBuilder::popupLazyBuild()
- 10.2.x modules/social_features/social_follow_taxonomy/modules/social_follow_tag/src/SocialFollowTagLazyBuilder.php \Drupal\social_follow_tag\SocialFollowTagLazyBuilder::popupLazyBuild()
Returns render array for tag follow popup.
Parameters
string $url: ULR of related content.
string|int $term_id: Taxonomy term ID.
string $field: Entity field name related to taxonomy.
string $entity_type: Entity type for related content counter.
Return value
array Render array.
File
- modules/
social_features/ social_follow_taxonomy/ modules/ social_follow_tag/ src/ SocialFollowTagLazyBuilder.php, line 187
Class
- SocialFollowTagLazyBuilder
- Provide service for lazy rendering.
Namespace
Drupal\social_follow_tagCode
public function popupLazyBuild($url, $term_id, $field, $entity_type) {
/** @var \Drupal\taxonomy\TermInterface $term */
$term = $this->entityTypeManager
->getStorage('taxonomy_term')
->load($term_id);
return [
'#theme' => 'social_tagging_popup',
'#url' => $url,
'#name' => $term
->label(),
'#flag' => social_follow_taxonomy_flag_link($term),
'#followers_count' => social_follow_taxonomy_term_followers_count($term),
'#related_entity_count' => social_follow_taxonomy_related_entity_count($term, $field, $entity_type),
];
}