You are here

function sendinblue_page_attachments in SendinBlue 8.2

Same name and namespace in other branches
  1. 8 sendinblue.module \sendinblue_page_attachments()

Add attachments (typically assets) to a page before it is rendered.

Parameters

array &$attachments: An array that you can add attachments to.

See also

hook_page_attachments_alter()

File

./sendinblue.module, line 57
The entry point of Sendinblue module.

Code

function sendinblue_page_attachments(array &$attachments) {
  if (\Drupal::service('router.admin_context')
    ->isAdminRoute()) {
    $route_match = \Drupal::routeMatch();
    if (strpos($route_match
      ->getRouteName(), 'sendinblue') !== FALSE) {
      $attachments['#attached']['library'][] = 'sendinblue/sendinblue.admin-setting';
    }
  }
}