script_manager.module in Script Manager 8
Manage JavaScript snippets included in your website.
File
script_manager.moduleView source
<?php
/**
* @file
* Manage JavaScript snippets included in your website.
*/
use Drupal\script_manager\Entity\ScriptInterface;
use Drupal\script_manager\ScriptPlacementManager;
/**
* Implements hook_page_bottom().
*/
function script_manager_page_bottom(&$page) {
$page['script_manager'] = \Drupal::service('class_resolver')
->getInstanceFromDefinition(ScriptPlacementManager::class)
->getRenderedScriptsForPosition(ScriptInterface::POSITION_BOTTOM);
}
/**
* Implements hook_page_top().
*/
function script_manager_page_top(&$page) {
$page['script_manager'] = \Drupal::service('class_resolver')
->getInstanceFromDefinition(ScriptPlacementManager::class)
->getRenderedScriptsForPosition(ScriptInterface::POSITION_TOP);
}
Functions
Name | Description |
---|---|
script_manager_page_bottom | Implements hook_page_bottom(). |
script_manager_page_top | Implements hook_page_top(). |