Merge pull request #1022 from wesleyh/master
Proposal: Default value for labels.
This commit is contained in:
commit
028689911f
1 file changed
+6
-1
+6
-1
@@ -176,12 +176,17 @@ class FormBuilder {
|
||||
* @param array $options
|
||||
* @return string
|
||||
*/
|
||||
public function label($name, $value, $options = array())
|
||||
public function label($name, $value = null, $options = array())
|
||||
{
|
||||
$this->labels[] = $name;
|
||||
|
||||
$options = $this->html->attributes($options);
|
||||
|
||||
if (is_null($value))
|
||||
{
|
||||
$value = ucwords(str_replace('_', ' ', $name));
|
||||
}
|
||||
|
||||
return '<label for="'.$name.'"'.$options.'>'.e($value).'</label>';
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user