You are here

public function OpignoCalendarRegion::render in Opigno calendar 3.x

Render the area.

Parameters

bool $empty: (optional) Indicator if view result is empty or not. Defaults to FALSE.

Return value

array In any case we need a valid Drupal render array to return.

Overrides AreaPluginBase::render

File

src/Plugin/views/area/OpignoCalendarRegion.php, line 21

Class

OpignoCalendarRegion
Defines a views area plugin.

Namespace

Drupal\opigno_calendar\Plugin\views\area

Code

public function render($empty = FALSE) {
  $add_url = URL::fromRoute('entity.opigno_calendar_event.add_form', [
    'opigno_calendar_event_type' => 'opigno_calendar_event',
  ]);
  $link = Link::fromTextAndUrl(t('Add'), $add_url)
    ->toString();
  return [
    '#theme' => 'opigno_calendar_add_event',
    '#add_event_link' => $link,
  ];
}