function opigno_h5p_page_attachments in Opigno module 3.x
Same name and namespace in other branches
- 8 ActivityTypes/opigno_h5p/opigno_h5p.module \opigno_h5p_page_attachments()
Implements hook_page_attachments().
File
- ActivityTypes/
opigno_h5p/ opigno_h5p.module, line 142 - Module main functionality.
Code
function opigno_h5p_page_attachments(array &$page) {
// Add h5p content libraries.
$route_name = \Drupal::routeMatch()
->getRouteName();
if (in_array($route_name, [
'opigno_module.module_result',
'opigno_module.module_result_form',
])) {
$page['#attached']['library'][] = 'opigno_h5p/opigno_h5p.all-libraries';
}
}