public function GroupMembershipController::leave in Group 8
Same name and namespace in other branches
- 2.0.x src/Controller/GroupMembershipController.php \Drupal\group\Controller\GroupMembershipController::leave()
Provides the form for leaving a group.
Parameters
\Drupal\group\Entity\GroupInterface $group: The group to leave.
Return value
array A group leave form.
1 string reference to 'GroupMembershipController::leave'
File
- src/
Controller/ GroupMembershipController.php, line 102
Class
- GroupMembershipController
- Provides group membership route controllers.
Namespace
Drupal\group\ControllerCode
public function leave(GroupInterface $group) {
$group_content = $group
->getMember($this->currentUser)
->getGroupContent();
return $this->entityFormBuilder
->getForm($group_content, 'group-leave');
}