You are here

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

/**
 * @file
 * Contains \Drupal\bat_booking_example\Controller\BatBookingExampleController.
 */
namespace Drupal\bat_booking_example\Controller;

use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;

/**
 *
 */
class BatBookingExampleController extends ControllerBase implements ContainerInjectionInterface {

  /**
   * Constructs a BatBookingExampleController object.
   */
  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,
    ];
  }

}

Classes