public function SocialAlbumController::add in Open Social 10.1.x
Same name and namespace in other branches
- 10.3.x modules/social_features/social_album/src/Controller/SocialAlbumController.php \Drupal\social_album\Controller\SocialAlbumController::add()
- 10.0.x modules/social_features/social_album/src/Controller/SocialAlbumController.php \Drupal\social_album\Controller\SocialAlbumController::add()
- 10.2.x modules/social_features/social_album/src/Controller/SocialAlbumController.php \Drupal\social_album\Controller\SocialAlbumController::add()
Set the current group as the default value of the group field.
Parameters
\Drupal\group\Entity\GroupInterface $group: The group object.
Return value
array The renderable array.
1 string reference to 'SocialAlbumController::add'
- social_album.routing.yml in modules/
social_features/ social_album/ social_album.routing.yml - modules/social_features/social_album/social_album.routing.yml
File
- modules/
social_features/ social_album/ src/ Controller/ SocialAlbumController.php, line 174
Class
- SocialAlbumController
- Returns responses for Album routes.
Namespace
Drupal\social_album\ControllerCode
public function add(GroupInterface $group) {
$node = $this
->entityTypeManager()
->getStorage('node')
->create([
'type' => 'album',
'groups' => $group,
]);
return $this
->entityFormBuilder()
->getForm($node);
}