public function BadgeController::add in User Badges 8
Add.
Return value
array Returns badge creation form.
1 string reference to 'BadgeController::add'
File
- src/
Controller/ BadgeController.php, line 89 - Contains \Drupal\user_badges\Controller\BadgeController.
Class
- BadgeController
- Class BadgeController.
Namespace
Drupal\user_badges\ControllerCode
public function add(BadgeTypeInterface $badge_type) {
$badge = $this
->entityTypeManager()
->getStorage('badge')
->create([
'type' => $badge_type
->id(),
]);
return $this
->entityFormBuilder()
->getForm($badge);
}