You are here

public function SocialGroupController::groupMembersTitle in Open Social 8

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_group/src/Controller/SocialGroupController.php \Drupal\social_group\Controller\SocialGroupController::groupMembersTitle()
  2. 8.2 modules/social_features/social_group/src/Controller/SocialGroupController.php \Drupal\social_group\Controller\SocialGroupController::groupMembersTitle()
  3. 8.3 modules/social_features/social_group/src/Controller/SocialGroupController.php \Drupal\social_group\Controller\SocialGroupController::groupMembersTitle()
  4. 8.4 modules/social_features/social_group/src/Controller/SocialGroupController.php \Drupal\social_group\Controller\SocialGroupController::groupMembersTitle()
  5. 8.5 modules/social_features/social_group/src/Controller/SocialGroupController.php \Drupal\social_group\Controller\SocialGroupController::groupMembersTitle()
  6. 8.6 modules/social_features/social_group/src/Controller/SocialGroupController.php \Drupal\social_group\Controller\SocialGroupController::groupMembersTitle()
  7. 8.7 modules/social_features/social_group/src/Controller/SocialGroupController.php \Drupal\social_group\Controller\SocialGroupController::groupMembersTitle()
  8. 8.8 modules/social_features/social_group/src/Controller/SocialGroupController.php \Drupal\social_group\Controller\SocialGroupController::groupMembersTitle()
  9. 10.3.x modules/social_features/social_group/src/Controller/SocialGroupController.php \Drupal\social_group\Controller\SocialGroupController::groupMembersTitle()
  10. 10.0.x modules/social_features/social_group/src/Controller/SocialGroupController.php \Drupal\social_group\Controller\SocialGroupController::groupMembersTitle()
  11. 10.1.x modules/social_features/social_group/src/Controller/SocialGroupController.php \Drupal\social_group\Controller\SocialGroupController::groupMembersTitle()
  12. 10.2.x modules/social_features/social_group/src/Controller/SocialGroupController.php \Drupal\social_group\Controller\SocialGroupController::groupMembersTitle()

The _title_callback for the view.group_members.page_group_members route.

Also for the entity.group_content.collection route.

Parameters

object $group: The group ID.

Return value

string The page title.

1 string reference to 'SocialGroupController::groupMembersTitle'
social_group.routing.yml in modules/social_features/social_group/social_group.routing.yml
modules/social_features/social_group/social_group.routing.yml

File

modules/social_features/social_group/src/Controller/SocialGroupController.php, line 23

Class

SocialGroupController
Returns responses for Social Group routes.

Namespace

Drupal\social_group\Controller

Code

public function groupMembersTitle($group) {
  if (is_object($group)) {
    $group_label = $group
      ->label();
  }
  else {
    $storage = \Drupal::entityTypeManager()
      ->getStorage('group');
    $group_entity = $storage
      ->load($group);
    $group_label = empty($group_entity) ? 'group' : $group_entity
      ->label();
  }
  return $this
    ->t('Members of @name', [
    '@name' => $group_label,
  ]);
}