1 | <?php |
||
13 | class Driver_Simple_Forms |
||
14 | { |
||
15 | /** |
||
16 | * DOMXPath object to perform queries with |
||
17 | * @var DOMXPath |
||
18 | */ |
||
19 | protected $_xpath; |
||
20 | |||
21 | 1 | function __construct($xpath) |
|
25 | |||
26 | /** |
||
27 | * Get the value of a DOMElement with a given xpath |
||
28 | * @param string $xpath |
||
29 | * @return mixed |
||
30 | */ |
||
31 | public function get_value($xpath) |
||
53 | |||
54 | /** |
||
55 | * Set the value of a DOMElement, identified by an xpath, calls one of the stter methods |
||
56 | * @param string $xpath |
||
57 | * @param mixed $value |
||
58 | */ |
||
59 | public function set_value($xpath, $value) |
||
88 | |||
89 | /** |
||
90 | * Set the value of a checkbos DOMNode |
||
91 | * @param DOMNode $checkbox |
||
92 | * @param boolean $value |
||
93 | */ |
||
94 | public function set_value_checkbox(\DOMNode $checkbox, $value) |
||
105 | |||
106 | /** |
||
107 | * Set the value of a radio DOMNode, uncheck any other radio input in the same group |
||
108 | * @param DOMNode $radio |
||
109 | * @param boolean $value |
||
110 | */ |
||
111 | public function set_value_radio(\DOMNode $radio, $value) |
||
123 | |||
124 | /** |
||
125 | * Set the value of a normal input |
||
126 | * @param DOMNode $input |
||
127 | * @param string $value |
||
128 | */ |
||
129 | public function set_value_input(\DOMNode $input, $value) |
||
133 | |||
134 | /** |
||
135 | * Set the value of a normal textarea |
||
136 | * @param DOMNode $textarea |
||
137 | * @param string $value |
||
138 | */ |
||
139 | public function set_value_textarea(\DOMNode $textarea, $value) |
||
143 | |||
144 | /** |
||
145 | * Set the value of an option DOMNode, unselect other options in this select, if it is not multiple |
||
146 | * @param DOMNode $option |
||
147 | * @param boolean $value |
||
148 | */ |
||
149 | public function set_value_option(\DOMNode $option, $value) |
||
170 | |||
171 | /** |
||
172 | * Return all the contents of file inputs in a form, identified by an xpath |
||
173 | * @param string $xpath |
||
174 | * @return string |
||
175 | */ |
||
176 | public function serialize_files($xpath) |
||
189 | |||
190 | /** |
||
191 | * Return the contents of all the inputs from a form, identified by an xpath. |
||
192 | * Don't include file inputs or disabled inputs |
||
193 | * @param string $xpath |
||
194 | * @return string |
||
195 | */ |
||
196 | public function serialize_form($xpath) |
||
227 | } |
||
228 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.