-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathticket.page.inc
52 lines (44 loc) · 1.37 KB
/
ticket.page.inc
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
46
47
48
49
50
51
52
<?php
/**
* @file
* Contains ticket.page.inc.
*
* Page callback for Ticket entities.
*/
use Drupal\Core\Render\Element;
/**
* Prepares variables for Ticket templates.
*
* Default template: ticket.html.twig.
*
* @param array $variables
* An associative array containing:
* - elements: An associative array containing the user information and any
* - attributes: HTML attributes for the containing element.
*/
function template_preprocess_ticket(array &$variables) {
// Fetch Ticket Entity Object.
$ticket = $variables['elements']['#ticket'];
// Helpful $content variable for templates.
foreach (Element::children($variables['elements']) as $key) {
$variables['content'][$key] = $variables['elements'][$key];
}
}
/**
* Prepares variables for Registration templates.
*
* Default template: registration.html.twig.
*
* @param array $variables
* An associative array containing:
* - elements: An associative array containing the user information and any
* - attributes: HTML attributes for the containing element.
*/
function template_preprocess_registration(array &$variables) {
// Fetch Ticket Entity Object.
$registration = $variables['elements']['#registration'];
// Helpful $content variable for templates.
foreach (Element::children($variables['elements']) as $key) {
$variables['content'][$key] = $variables['elements'][$key];
}
}