You are here

public function BadgeController::add in User Badges 8

Add.

Return value

array Returns badge creation form.

1 string reference to 'BadgeController::add'
user_badges.routing.yml in ./user_badges.routing.yml
user_badges.routing.yml

File

src/Controller/BadgeController.php, line 89
Contains \Drupal\user_badges\Controller\BadgeController.

Class

BadgeController
Class BadgeController.

Namespace

Drupal\user_badges\Controller

Code

public function add(BadgeTypeInterface $badge_type) {
  $badge = $this
    ->entityTypeManager()
    ->getStorage('badge')
    ->create([
    'type' => $badge_type
      ->id(),
  ]);
  return $this
    ->entityFormBuilder()
    ->getForm($badge);
}