1 | <?php |
||
11 | abstract class AbstractTemplate implements TemplateInterface |
||
12 | { |
||
13 | /** @var array */ |
||
14 | private $variables; |
||
15 | |||
16 | /** |
||
17 | * @param array $variables |
||
18 | */ |
||
19 | public function __construct($variables = array()) |
||
23 | |||
24 | /** |
||
25 | * @param array $variables |
||
26 | * @return string |
||
27 | */ |
||
28 | public function __invoke($variables = array()) |
||
34 | |||
35 | /** |
||
36 | * @param array $variables |
||
37 | * @param bool $mergeWithExisting |
||
38 | */ |
||
39 | public function assignMany(array $variables, $mergeWithExisting = true) |
||
47 | |||
48 | /** |
||
49 | * @param string $key |
||
50 | * @param mixed $value |
||
51 | */ |
||
52 | public function assignOne($key, $value) |
||
56 | |||
57 | /** |
||
58 | * @param string $key |
||
59 | * @return bool |
||
60 | */ |
||
61 | public function isAssigned($key) |
||
65 | |||
66 | /** |
||
67 | * @return string |
||
68 | * @throws RuntimeException |
||
69 | */ |
||
70 | public function render() |
||
78 | |||
79 | public function reset() |
||
83 | |||
84 | /** |
||
85 | * @return string |
||
86 | * @throws RuntimeException |
||
87 | */ |
||
88 | public function __toString() |
||
92 | |||
93 | /** |
||
94 | * @return string |
||
95 | * @throws RuntimeException |
||
96 | */ |
||
97 | abstract protected function getContent(); |
||
98 | |||
99 | /** |
||
100 | * @param string $key |
||
101 | * @return null|mixed |
||
102 | */ |
||
103 | protected function getValueByKeyOrNull($key) |
||
109 | |||
110 | /** |
||
111 | * @return array |
||
112 | */ |
||
113 | protected function getVariables() |
||
117 | } |
||
118 |