BatBookingExampleController.php in Booking and Availability Management Tools for Drupal 8
File
modules/bat_booking/bat_booking_example/src/Controller/BatBookingExampleController.php
View source
<?php
namespace Drupal\bat_booking_example\Controller;
use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
class BatBookingExampleController extends ControllerBase implements ContainerInjectionInterface {
public function __construct() {
}
public function batBookingConfirmationPage($start_date, $end_date, $type_id) {
$header = $start_date
->format('Y-m-d') . ' - ' . $end_date
->format('Y-m-d');
$form = $this
->formBuilder()
->getForm('Drupal\\bat_booking_example\\Form\\BookingConfirmationForm', $start_date, $end_date, $type_id);
return [
'#theme' => 'booking_confirmation_page',
'#header' => $header,
'#form' => $form,
];
}
}