You are here

public function GroupContentController::createFormTitle in Group 8

Same name and namespace in other branches
  1. 2.0.x 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 content enabler to create content with.

Return value

string The page title.

File

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

Class

GroupContentController
Returns responses for GroupContent routes.

Namespace

Drupal\group\Entity\Controller

Code

public function createFormTitle(GroupInterface $group, $plugin_id) {

  /** @var \Drupal\group\Plugin\GroupContentEnablerInterface $plugin */
  $plugin = $group
    ->getGroupType()
    ->getContentPlugin($plugin_id);
  $group_content_type = GroupContentType::load($plugin
    ->getContentTypeConfigId());
  return $this
    ->t('Add @name', [
    '@name' => $group_content_type
      ->label(),
  ]);
}