You are here

public function GroupContentController::createFormTitle in Group 2.0.x

Same name and namespace in other branches
  1. 8 src/Entity/Controller/GroupContentController.php \Drupal\group\Entity\Controller\GroupContentController::createFormTitle()

The _title_callback for the entity.group_content.create_form route.

Parameters

\Drupal\group\Entity\GroupInterface $group: The group to create the group content in.

string $plugin_id: The group relation to create content with.

Return value

string The page title.

File

src/Entity/Controller/GroupContentController.php, line 372

Class

GroupContentController
Returns responses for GroupContent routes.

Namespace

Drupal\group\Entity\Controller

Code

public function createFormTitle(GroupInterface $group, $plugin_id) {
  $plugin = $group
    ->getGroupType()
    ->getContentPlugin($plugin_id);
  $group_content_type = GroupContentType::load($plugin
    ->getContentTypeConfigId());
  return $this
    ->t('Add @name', [
    '@name' => $group_content_type
      ->label(),
  ]);
}