1 | <?php /** MicroFieldTagTrait */ |
||
18 | trait FieldTagTrait |
||
19 | { |
||
20 | use TagTrait; |
||
21 | |||
22 | |||
23 | /** |
||
24 | * Render input button tag |
||
25 | * |
||
26 | * @access public |
||
27 | * |
||
28 | * @param string $name button name |
||
29 | * @param string $value button value |
||
30 | * @param array $attributes attributes tag |
||
31 | * |
||
32 | * @return string |
||
33 | * @static |
||
34 | */ |
||
35 | public static function buttonField($name, $value = null, array $attributes = []) |
||
39 | |||
40 | /** |
||
41 | * Base field tag |
||
42 | * |
||
43 | * @access private |
||
44 | * |
||
45 | * @param string $type type of element |
||
46 | * @param string $name name of element |
||
47 | * @param string $value value of element |
||
48 | * @param array $attributes attributes tag |
||
49 | * |
||
50 | * @return string |
||
51 | * @static |
||
52 | */ |
||
53 | private static function field($type, $name, $value = null, array $attributes = []) |
||
62 | |||
63 | /** |
||
64 | * Render input file tag |
||
65 | * |
||
66 | * @access public |
||
67 | * |
||
68 | * @param string $name file name |
||
69 | * @param string $value file value |
||
70 | * @param array $attributes attributes tag |
||
71 | * |
||
72 | * @return string |
||
73 | * @static |
||
74 | */ |
||
75 | public static function fileField($name, $value = null, array $attributes = []) |
||
79 | |||
80 | /** |
||
81 | * Render input hidden tag |
||
82 | * |
||
83 | * @access public |
||
84 | * |
||
85 | * @param string $name hidden name |
||
86 | * @param string $value hidden value |
||
87 | * @param array $attributes attributes tag |
||
88 | * |
||
89 | * @return string |
||
90 | * @static |
||
91 | */ |
||
92 | public static function hiddenField($name, $value = null, array $attributes = []) |
||
96 | |||
97 | /** |
||
98 | * Render input image tag |
||
99 | * |
||
100 | * @access public |
||
101 | * |
||
102 | * @param string $name image name |
||
103 | * @param string $value image value |
||
104 | * @param string $srcFile path to image |
||
105 | * @param array $attributes attributes tag |
||
106 | * |
||
107 | * @return string |
||
108 | * @static |
||
109 | */ |
||
110 | public static function imageField($name, $value = null, $srcFile, array $attributes = []) |
||
116 | |||
117 | /** |
||
118 | * Render input password tag |
||
119 | * |
||
120 | * @access public |
||
121 | * |
||
122 | * @param string $name password name |
||
123 | * @param string $value password value |
||
124 | * @param array $attributes attributes tag |
||
125 | * |
||
126 | * @return string |
||
127 | * @static |
||
128 | */ |
||
129 | public static function passwordField($name, $value = null, array $attributes = []) |
||
133 | |||
134 | /** |
||
135 | * Render input text tag |
||
136 | * |
||
137 | * @access public |
||
138 | * |
||
139 | * @param string $name text name |
||
140 | * @param string $value text value |
||
141 | * @param array $attributes attributes tag |
||
142 | * |
||
143 | * @return string |
||
144 | * @static |
||
145 | */ |
||
146 | public static function textField($name, $value = null, array $attributes = []) |
||
150 | |||
151 | /** |
||
152 | * Render input color tag |
||
153 | * |
||
154 | * @access public |
||
155 | * |
||
156 | * @param string $name color name |
||
157 | * @param string $value color value |
||
158 | * @param array $attributes attributes tag |
||
159 | * |
||
160 | * @return string |
||
161 | * @static |
||
162 | */ |
||
163 | public static function colorField($name, $value = null, array $attributes = []) |
||
167 | |||
168 | /** |
||
169 | * Render input date tag |
||
170 | * |
||
171 | * @access public |
||
172 | * |
||
173 | * @param string $name date name |
||
174 | * @param string $value date value |
||
175 | * @param array $attributes attributes tag |
||
176 | * |
||
177 | * @return string |
||
178 | * @static |
||
179 | */ |
||
180 | public static function dateField($name, $value = null, array $attributes = []) |
||
184 | |||
185 | /** |
||
186 | * Render input datetime tag |
||
187 | * |
||
188 | * @access public |
||
189 | * |
||
190 | * @param string $name datetime name |
||
191 | * @param string $value datetime value |
||
192 | * @param array $attributes attributes tag |
||
193 | * |
||
194 | * @return string |
||
195 | * @static |
||
196 | */ |
||
197 | public static function datetimeField($name, $value = null, array $attributes = []) |
||
201 | |||
202 | /** |
||
203 | * Render input datetime-local tag |
||
204 | * |
||
205 | * @access public |
||
206 | * |
||
207 | * @param string $name datetime-local name |
||
208 | * @param string $value datetime-local value |
||
209 | * @param array $attributes attributes tag |
||
210 | * |
||
211 | * @return string |
||
212 | * @static |
||
213 | */ |
||
214 | public static function datetimeLocalField($name, $value = null, array $attributes = []) |
||
218 | |||
219 | /** |
||
220 | * Render input email tag |
||
221 | * |
||
222 | * @access public |
||
223 | * |
||
224 | * @param string $name email name |
||
225 | * @param string $value email value |
||
226 | * @param array $attributes attributes tag |
||
227 | * |
||
228 | * @return string |
||
229 | * @static |
||
230 | */ |
||
231 | public static function emailField($name, $value = null, array $attributes = []) |
||
235 | |||
236 | /** |
||
237 | * Render input number tag |
||
238 | * |
||
239 | * @access public |
||
240 | * |
||
241 | * @param string $name number name |
||
242 | * @param string $value number value |
||
243 | * @param array $attributes attributes tag |
||
244 | * |
||
245 | * @return string |
||
246 | * @static |
||
247 | */ |
||
248 | public static function numberField($name, $value = null, array $attributes = []) |
||
252 | |||
253 | /** |
||
254 | * Render input range tag |
||
255 | * |
||
256 | * @access public |
||
257 | * |
||
258 | * @param string $name range name |
||
259 | * @param string $value range value |
||
260 | * @param array $attributes attributes tag |
||
261 | * |
||
262 | * @return string |
||
263 | * @static |
||
264 | */ |
||
265 | public static function rangeField($name, $value = null, array $attributes = []) |
||
269 | |||
270 | /** |
||
271 | * Render input search tag |
||
272 | * |
||
273 | * @access public |
||
274 | * |
||
275 | * @param string $name search name |
||
276 | * @param string $value search value |
||
277 | * @param array $attributes attributes tag |
||
278 | * |
||
279 | * @return string |
||
280 | * @static |
||
281 | */ |
||
282 | public static function searchField($name, $value = null, array $attributes = []) |
||
286 | |||
287 | /** |
||
288 | * Render input tel tag |
||
289 | * |
||
290 | * @access public |
||
291 | * |
||
292 | * @param string $name telephone name |
||
293 | * @param string $value telephone value |
||
294 | * @param array $attributes attributes tag |
||
295 | * |
||
296 | * @return string |
||
297 | * @static |
||
298 | */ |
||
299 | public static function telField($name, $value = null, array $attributes = []) |
||
303 | |||
304 | /** |
||
305 | * Render input time tag |
||
306 | * |
||
307 | * @access public |
||
308 | * |
||
309 | * @param string $name time name |
||
310 | * @param string $value time value |
||
311 | * @param array $attributes attributes tag |
||
312 | * |
||
313 | * @return string |
||
314 | * @static |
||
315 | */ |
||
316 | public static function timeField($name, $value = null, array $attributes = []) |
||
320 | |||
321 | /** |
||
322 | * Render input url tag |
||
323 | * |
||
324 | * @access public |
||
325 | * |
||
326 | * @param string $name url name |
||
327 | * @param string $value url path |
||
328 | * @param array $attributes attributes tag |
||
329 | * |
||
330 | * @return string |
||
331 | * @static |
||
332 | */ |
||
333 | public static function urlField($name, $value = null, array $attributes = []) |
||
337 | |||
338 | /** |
||
339 | * Render input month tag |
||
340 | * |
||
341 | * @access public |
||
342 | * |
||
343 | * @param string $name month name |
||
344 | * @param string $value month value |
||
345 | * @param array $attributes attributes tag |
||
346 | * |
||
347 | * @return string |
||
348 | * @static |
||
349 | */ |
||
350 | public static function monthField($name, $value = null, array $attributes = []) |
||
354 | |||
355 | /** |
||
356 | * Render input week tag |
||
357 | * |
||
358 | * @access public |
||
359 | * |
||
360 | * @param string $name week name |
||
361 | * @param string $value week value |
||
362 | * @param array $attributes attributes tag |
||
363 | * |
||
364 | * @return string |
||
365 | * @static |
||
366 | */ |
||
367 | public static function weekField($name, $value = null, array $attributes = []) |
||
371 | |||
372 | /** |
||
373 | * Render radio button list tag |
||
374 | * |
||
375 | * @access public |
||
376 | * |
||
377 | * @param string $name radio name |
||
378 | * @param array $radios format array(text, value, attributes) |
||
379 | * @param string $format %radio% - radio , %text% - text |
||
380 | * @param string $selected name selected element |
||
381 | * |
||
382 | * @return string |
||
383 | * @static |
||
384 | */ |
||
385 | public static function radioButtonList($name, array $radios = [], $format = '<p>%radio% %text%</p>', $selected = '') |
||
399 | |||
400 | /** |
||
401 | * Render input radio tag |
||
402 | * |
||
403 | * @access public |
||
404 | * |
||
405 | * @param string $name radio name |
||
406 | * @param string $value radio value |
||
407 | * @param array $attributes attributes tag |
||
408 | * |
||
409 | * @return string |
||
410 | * @static |
||
411 | */ |
||
412 | public static function radioField($name, $value = null, array $attributes = []) |
||
416 | |||
417 | /** |
||
418 | * Render checkBoxList (input checkbox tags) |
||
419 | * |
||
420 | * @access public |
||
421 | * |
||
422 | * @param string $name name for checkBox'es in list |
||
423 | * @param array $checkboxes format array(text, value, attributes) |
||
424 | * @param string $format %check% - checkbox , %text% - text |
||
425 | * @param string $selected name selected element |
||
426 | * |
||
427 | * @return string |
||
428 | * @static |
||
429 | */ |
||
430 | public static function checkBoxList( |
||
447 | |||
448 | /** |
||
449 | * Render input checkbox tag |
||
450 | * |
||
451 | * @access public |
||
452 | * |
||
453 | * @param string $name checkBox name |
||
454 | * @param string $value checkBox value |
||
455 | * @param array $attributes attributes tag |
||
456 | * |
||
457 | * @return string |
||
458 | * @static |
||
459 | */ |
||
460 | public static function checkBoxField($name, $value = null, array $attributes = []) |
||
464 | } |
||
465 |