You are here

public function bat_booking_example_book_this_field::render in Booking and Availability Management Tools for Drupal 7

Render the field.

Parameters

$values: The values retrieved from the database.

Overrides entity_views_handler_field_text::render

File

modules/bat_booking/bat_booking_example/views/bat_booking_example_book_this_field.inc, line 15

Class

bat_booking_example_book_this_field

Code

public function render($values) {
  if (isset($_GET['bat_start_date']) && isset($_GET['bat_end_date'])) {
    return l(t('Book this'), 'booking/' . $_GET['bat_start_date'] . '/' . $_GET['bat_end_date'] . '/' . $values->entity);
  }
  else {
    return '<em>' . t('Insert dates to book') . '</em>';
  }
}