1 | <?php |
||
16 | trait TemplateOutput |
||
17 | { |
||
18 | /** @var Smarty */ |
||
19 | private $smarty; |
||
20 | /** @var string Extra JavaScript to include at the end of the page's execution */ |
||
21 | private $tailScript; |
||
22 | |||
23 | /** |
||
24 | * @return SiteConfiguration |
||
25 | */ |
||
26 | protected abstract function getSiteConfiguration(); |
||
27 | |||
28 | /** |
||
29 | * Include extra JavaScript at the end of the page's execution |
||
30 | * |
||
31 | * @param $script string JavaScript to include at the end of the page |
||
32 | */ |
||
33 | final protected function setTailScript($script) |
||
37 | |||
38 | /** |
||
39 | * Assigns a Smarty variable |
||
40 | * |
||
41 | * @param array|string $name the template variable name(s) |
||
42 | * @param mixed $value the value to assign |
||
43 | */ |
||
44 | final protected function assign($name, $value) |
||
48 | |||
49 | /** |
||
50 | * Sets up the variables used by the main Smarty base template. |
||
51 | * |
||
52 | * This list is getting kinda long. |
||
53 | */ |
||
54 | final protected function setUpSmarty() |
||
88 | |||
89 | /** |
||
90 | * Fetches a rendered Smarty template |
||
91 | * |
||
92 | * @param $template string Template file path, relative to /templates/ |
||
93 | * |
||
94 | * @return string Templated HTML |
||
95 | */ |
||
96 | final protected function fetchTemplate($template) |
||
102 | } |
||
103 |