You are here

public function GroupMembershipController::leave in Group 8

Same name and namespace in other branches
  1. 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'
group.routing.yml in ./group.routing.yml
group.routing.yml

File

src/Controller/GroupMembershipController.php, line 102

Class

GroupMembershipController
Provides group membership route controllers.

Namespace

Drupal\group\Controller

Code

public function leave(GroupInterface $group) {
  $group_content = $group
    ->getMember($this->currentUser)
    ->getGroupContent();
  return $this->entityFormBuilder
    ->getForm($group_content, 'group-leave');
}