public function GroupRelationBase::getGroupOperations in Group 2.0.x
Provides a list of operations for a group.
These operations can be implemented in numerous ways by extending modules. Out of the box, Group provides a block that shows the available operations to a user visiting a route with a group in its URL.
Do not forget to specify cacheable metadata if you need to. This can be done in ::getGroupOperationsCacheableMetadata().
Parameters
\Drupal\group\Entity\GroupInterface $group: The group to generate the operations for.
Return value
array An associative array of operation links to show when in a group context, keyed by operation name, containing the following key-value pairs:
- title: The localized title of the operation.
- url: An instance of \Drupal\Core\Url for the operation URL.
- weight: The weight of the operation.
Overrides GroupRelationInterface::getGroupOperations
See also
::getGroupOperationsCacheableMetadata()
2 methods override GroupRelationBase::getGroupOperations()
- GroupMembership::getGroupOperations in src/
Plugin/ Group/ Relation/ GroupMembership.php - Provides a list of operations for a group.
- GroupNode::getGroupOperations in modules/
gnode/ src/ Plugin/ Group/ Relation/ GroupNode.php - Provides a list of operations for a group.
File
- src/
Plugin/ Group/ Relation/ GroupRelationBase.php, line 195
Class
- GroupRelationBase
- Provides a base class for GroupContentEnabler plugins.
Namespace
Drupal\group\Plugin\Group\RelationCode
public function getGroupOperations(GroupInterface $group) {
return [];
}