diff --git a/FormBuilder.php b/FormBuilder.php index c6fb6c3..3dfa472 100644 --- a/FormBuilder.php +++ b/FormBuilder.php @@ -176,12 +176,16 @@ class FormBuilder { * @param array $options * @return string */ - public function label($name, $value, $options = array()) + public function label($name, $value='', $options = array()) { $this->labels[] = $name; $options = $this->html->attributes($options); + if (!$value) { + $value = ucfirst(str_replace('_', ' ', $name)) . ': '; + } + return ''; }