You are here

function opigno_calendar_page_attachments in Opigno calendar 8

Same name and namespace in other branches
  1. 3.x opigno_calendar.module \opigno_calendar_page_attachments()

Implements hook_page_attachments().

File

./opigno_calendar.module, line 31
Contains opigno_calendar.module.

Code

function opigno_calendar_page_attachments(array &$page) {
  $route = \Drupal::routeMatch()
    ->getRouteName();

  // Attach library to front page.
  if (in_array($route, [
    'opigno_dashboard.dashboard_admin_default_settings',
    'view.frontpage.page_1',
  ])) {
    $page['#attached']['library'][] = 'opigno_calendar/month_block';
  }
}