You are here

public function EventController::add in Booking and Availability Management Tools for Drupal 8

Provides the event submission form.

Parameters

\Drupal\bat_event\EventTypeInterface $event_type: The event type entity for the event.

Return value

array An event submission form.

1 string reference to 'EventController::add'
bat_event.routing.yml in modules/bat_event/bat_event.routing.yml
modules/bat_event/bat_event.routing.yml

File

modules/bat_event/src/Controller/EventController.php, line 97
Contains \Drupal\bat_event\Controller\EventController.

Class

EventController
Returns responses for Type routes.

Namespace

Drupal\bat_event\Controller

Code

public function add(EventTypeInterface $event_type) {
  $type = $this
    ->entityTypeManager()
    ->getStorage('bat_event')
    ->create([
    'type' => $event_type
      ->id(),
  ]);
  $form = $this
    ->entityFormBuilder()
    ->getForm($type);
  return $form;
}