1 | <?php |
||
9 | class CThemeBasic implements IThemeEngine, \Anax\DI\IInjectionAware |
||
10 | { |
||
11 | use \Anax\TConfigure, |
||
12 | \Anax\DI\TInjectionAware; |
||
13 | |||
14 | |||
15 | |||
16 | /** |
||
17 | * Properties |
||
18 | * |
||
19 | */ |
||
20 | protected $data = []; // Array with variables to provide to template files. |
||
21 | |||
22 | |||
23 | |||
24 | /** |
||
25 | * Shortcut to set title. |
||
26 | * |
||
27 | * @param string $value of the variable. |
||
28 | * |
||
29 | * @return $this |
||
30 | */ |
||
31 | public function setTitle($value) |
||
35 | |||
36 | |||
37 | |||
38 | /** |
||
39 | * Set a base title which is appended to the page title. |
||
40 | * |
||
41 | * @param string $value of the variable. |
||
42 | * |
||
43 | * @return $this |
||
44 | */ |
||
45 | public function setBaseTitle($value) |
||
49 | |||
50 | |||
51 | |||
52 | /** |
||
53 | * Set a variable which will be exposed to the template files during render. |
||
54 | * |
||
55 | * @param string $which variable to set value of. |
||
56 | * @param mixed $value of the variable. |
||
57 | * |
||
58 | * @return $this |
||
59 | */ |
||
60 | public function setVariable($which, $value) |
||
65 | |||
66 | |||
67 | |||
68 | /** |
||
69 | * Get a value of a variable which will be exposed to the template files |
||
70 | * during render. |
||
71 | * |
||
72 | * @param string $which variable to get value of. |
||
73 | * |
||
74 | * @return mixed as value of variable, or null if value is not set. |
||
75 | */ |
||
76 | public function getVariable($which) |
||
86 | |||
87 | |||
88 | |||
89 | /** |
||
90 | * Add a stylesheet. |
||
91 | * |
||
92 | * @param string $uri to add. |
||
93 | * |
||
94 | * @return $this |
||
95 | */ |
||
96 | public function addStylesheet($uri) |
||
101 | |||
102 | |||
103 | |||
104 | /** |
||
105 | * Add a javascript asset. |
||
106 | * |
||
107 | * @param string $uri to add. |
||
108 | * |
||
109 | * @return $this |
||
110 | */ |
||
111 | public function addJavaScript($uri) |
||
116 | |||
117 | |||
118 | |||
119 | /** |
||
120 | * Render the theme by applying the variables onto the template files. |
||
121 | * |
||
122 | * @return void |
||
123 | */ |
||
124 | public function render() |
||
156 | } |
||
157 |