function external_page_attachments in External New Tab 8
Implements hook_page_attachments().
File
- ./
external.module, line 20
Code
function external_page_attachments(&$page) {
$settings = [
'externalpdf' => \Drupal::config('external.settings')
->get('external_docs_enabled'),
];
if (external_active() && \Drupal::config('external.settings')
->get('external_enabled')) {
$page['#attached']['drupalSettings']['external'] = $settings;
$page['#attached']['library'][] = 'external/external';
}
}