You are here

public function GroupContentController::addFormTitle in Group 8

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

The _title_callback for the entity.group_content.add_form route.

Parameters

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

string $plugin_id: The group content enabler to add content with.

Return value

string The page title.

File

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

Class

GroupContentController
Returns responses for GroupContent routes.

Namespace

Drupal\group\Entity\Controller

Code

public function addFormTitle(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(),
  ]);
}