Example #1
0
 public function writeLabel()
 {
     // Writes label for form control
     $html = false;
     if (isset($this->labelText)) {
         if ($this->type == 'heading') {
             $html = "<label class=\"strong control-label ";
             if ($this->hasClass('centre')) {
                 $html .= "text-center";
             }
             $html .= "\">{$this->labelText}</label>";
         } else {
             // Writes HTML for labelText
             $label = new HTMLLabel($this->labelText, $this->id);
             // instantiate at this point to ensure id available
             $label->addClass('control-label');
             $html = $label->writeHTML();
         }
     }
     return $html;
 }