1 | <?php |
||
27 | class FieldViewHelperService implements SingletonInterface |
||
28 | { |
||
29 | /** |
||
30 | * Contains all current fields being rendered by FormZ: if a field is |
||
31 | * rendered beneath another field, several entries will be added to this |
||
32 | * property. |
||
33 | * |
||
34 | * @var FieldContextEntry[] |
||
35 | */ |
||
36 | protected $contextEntries; |
||
37 | |||
38 | /** |
||
39 | * @var StandaloneView[] |
||
40 | */ |
||
41 | protected $view; |
||
42 | |||
43 | /** |
||
44 | * Adds a new context entry to the entries array. The other field-related |
||
45 | * methods will be processed on this entry until the field rendering has |
||
46 | * ended. |
||
47 | * |
||
48 | * @param Field $field |
||
49 | */ |
||
50 | public function setCurrentField(Field $field) |
||
54 | |||
55 | /** |
||
56 | * Removes the current field context entry. |
||
57 | */ |
||
58 | public function removeCurrentField() |
||
62 | |||
63 | /** |
||
64 | * Checks that a field context is found. |
||
65 | * |
||
66 | * @return bool |
||
67 | */ |
||
68 | public function fieldContextExists() |
||
72 | |||
73 | /** |
||
74 | * @return Field |
||
75 | */ |
||
76 | public function getCurrentField() |
||
80 | |||
81 | /** |
||
82 | * @param string $name |
||
83 | * @param mixed $value |
||
84 | */ |
||
85 | public function setFieldOption($name, $value) |
||
89 | |||
90 | /** |
||
91 | * @return array |
||
92 | */ |
||
93 | public function getFieldOptions() |
||
97 | |||
98 | /** |
||
99 | * Returns a view instance, based on the template file of the layout. The |
||
100 | * view is stored in local cache, to improve performance: the template file |
||
101 | * content will be fetched only once. |
||
102 | * |
||
103 | * @param Layout $layout |
||
104 | * @return StandaloneView |
||
105 | */ |
||
106 | public function getView(Layout $layout) |
||
120 | |||
121 | /** |
||
122 | * @return FieldContextEntry |
||
123 | */ |
||
124 | protected function getCurrentContext() |
||
128 | } |
||
129 |