1 | <?php |
||
10 | class Data |
||
11 | { |
||
12 | /** |
||
13 | * Variables shared by all templates. |
||
14 | * @var array |
||
15 | */ |
||
16 | protected $sharedVariables = array(); |
||
17 | |||
18 | /** |
||
19 | * Specific template variables. |
||
20 | * @var array |
||
21 | */ |
||
22 | protected $templateVariables = array(); |
||
23 | |||
24 | /** |
||
25 | * Add template data. |
||
26 | * @param array $data; |
||
27 | * @param null|string|array $templates; |
||
28 | * @return Data |
||
29 | */ |
||
30 | 16 | public function add(array $data, $templates = null) |
|
48 | |||
49 | /** |
||
50 | * Add data shared with all templates. |
||
51 | * @param array $data; |
||
52 | * @return Data |
||
53 | */ |
||
54 | 4 | public function shareWithAll($data) |
|
60 | |||
61 | /** |
||
62 | * Add data shared with some templates. |
||
63 | * @param array $data; |
||
64 | * @param array $templates; |
||
65 | * @return Data |
||
66 | */ |
||
67 | 10 | public function shareWithSome($data, array $templates) |
|
79 | |||
80 | /** |
||
81 | * Get template data. |
||
82 | * @param null|string $template; |
||
83 | * @return array |
||
84 | */ |
||
85 | 76 | public function get($template = null) |
|
93 | } |
||
94 |