form_element helper now supports empty labels

This commit is contained in:
Felix Favre 2014-12-06 20:01:47 +01:00
parent 20d4b1b1c3
commit b97154d19e
1 changed files with 5 additions and 1 deletions

View File

@ -232,7 +232,11 @@ function form_select($name, $label, $values, $selected) {
* Rendert ein Formular-Element
*/
function form_element($label, $input, $for = "") {
return '<div class="form-group">' . '<label for="' . $for . '">' . $label . '</label>' . $input . '</div>';
if ($label == '') {
return '<div class="form-group">' . $input . '</div>';
}else {
return '<div class="form-group">' . '<label for="' . $for . '">' . $label . '</label>' . $input . '</div>';
}
}
/**