-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvars_to_javascript.module
More file actions
45 lines (38 loc) · 977 Bytes
/
vars_to_javascript.module
File metadata and controls
45 lines (38 loc) · 977 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/**
* @file
* Contains vars_to_javascript.module.
*/
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function vars_to_javascript_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
// Main module help for the vars_to_javascript module.
case 'help.page.vars_to_javascript':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('Transform PHP types to JavaScript') . '</p>';
return $output;
default:
}
}
function phpexcel_preprocess_html(&$variables) {
$set_bottom_script = [
'#type' => 'inline_template',
'#template' => '{{ javascript|raw }}',
'#context' => [
'javascript' => set_bottom_script(),
]
];
$variables['page_bottom'] = ['bottom_script' => $set_bottom_script];
}
function set_bottom_script($js = NULL){
global $bottom_script ;
if ($js) {
$bottom_script = $js;
}else{
return $bottom_script;
}
}