highlight.module in Highlight 8
Same filename and directory in other branches
Hooks for the Highlight module.
File
highlight.moduleView source
<?php
/**
* @file
* Hooks for the Highlight module.
*/
/**
* Implements hook_page_attachments().
*/
function highlight_page_attachments(array &$attachments) {
$config = \Drupal::config('highlight.settings');
$attachments['#attached']['library'][] = 'highlight/highlight';
$attachments['#attached']['drupalSettings']['highlight'] = [
'area' => $config
->get('area'),
'class' => $config
->get('class'),
'color' => $config
->get('color'),
'textColor' => $config
->get('text_color'),
'wordsonly' => $config
->get('wordsonly'),
'patterns' => implode("\n", $config
->get('patterns')),
'referrerPatterns' => implode("\n", $config
->get('patterns_referrer')),
'stopwords' => $config
->get('stopwords'),
];
}
Functions
Name | Description |
---|---|
highlight_page_attachments | Implements hook_page_attachments(). |