@@ 286-301 (lines=16) @@ | ||
283 | * @param string a string to be attached to the end of the attributes |
|
284 | * @return string |
|
285 | */ |
|
286 | public static function checkbox($data, $value = '', $checked = false, $extra = '') |
|
287 | { |
|
288 | if (! is_array($data)) { |
|
289 | $data = array('name' => $data); |
|
290 | } |
|
291 | ||
292 | $data['type'] = 'checkbox'; |
|
293 | ||
294 | if ($checked == true or (isset($data['checked']) and $data['checked'] == true)) { |
|
295 | $data['checked'] = 'checked'; |
|
296 | } else { |
|
297 | unset($data['checked']); |
|
298 | } |
|
299 | ||
300 | return form::input($data, $value, $extra); |
|
301 | } |
|
302 | ||
303 | /** |
|
304 | * Creates an HTML form radio input tag. |
|
@@ 312-327 (lines=16) @@ | ||
309 | * @param string a string to be attached to the end of the attributes |
|
310 | * @return string |
|
311 | */ |
|
312 | public static function radio($data = '', $value = '', $checked = false, $extra = '') |
|
313 | { |
|
314 | if (! is_array($data)) { |
|
315 | $data = array('name' => $data); |
|
316 | } |
|
317 | ||
318 | $data['type'] = 'radio'; |
|
319 | ||
320 | if ($checked == true or (isset($data['checked']) and $data['checked'] == true)) { |
|
321 | $data['checked'] = 'checked'; |
|
322 | } else { |
|
323 | unset($data['checked']); |
|
324 | } |
|
325 | ||
326 | return form::input($data, $value, $extra); |
|
327 | } |
|
328 | ||
329 | /** |
|
330 | * Creates an HTML form submit input tag. |