public function GroupContentController::addFormTitle in Group 2.0.x
Same name and namespace in other branches
- 8 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 relation to add content with.
Return value
string The page title.
File
- src/
Entity/ Controller/ GroupContentController.php, line 250
Class
- GroupContentController
- Returns responses for GroupContent routes.
Namespace
Drupal\group\Entity\ControllerCode
public function addFormTitle(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(),
]);
}