Changeset 1458
- Timestamp:
- 12/07/2007 05:37:16 PM (10 months ago)
- Files:
-
- 1 modified
-
trunk/modules/forge/libraries/Form_Checkbox.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/forge/libraries/Form_Checkbox.php
r1439 r1458 24 24 } 25 25 26 public function label($val = NULL) 27 { 28 if ($val === NULL) 29 { 30 return ''; 31 } 32 else 33 { 34 $this->data['label'] = ($val === TRUE) ? ucwords(inflector::humanize($this->name)) : $val; 35 return $this; 36 } 37 } 38 26 39 protected function html_element() 27 40 { 28 // Get the41 // Import the data 29 42 $data = $this->data; 30 43 31 // Remove label 32 unset($data['label']); 44 if ($label = arr::remove('label', $data)) 45 { 46 // There must be one space before the text 47 $label = ' '.ltrim($label); 48 } 33 49 34 return form::checkbox($data);50 return '<label>'.form::checkbox($data).$label.'</label>'; 35 51 } 36 52
