You are here

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

Provides the event edit form.

Parameters

\Drupal\bat_event\EventInterface $event: The event event for edit.

Return value

array An event edit form.

File

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

Class

EventController
Returns responses for Type routes.

Namespace

Drupal\bat_event\Controller

Code

public function editEvent(EventInterface $event) {
  $input = $this->request->request
    ->all();
  $programmed = isset($input['form_id']);
  $input['form_id'] = 'bat_event_' . $event
    ->bundle() . '_edit_form';
  $form = $this
    ->entityFormBuilder()
    ->getForm($event, 'default', [
    'programmed' => $programmed,
    'input' => $input,
  ]);
  return $form;
}