Example #1
0
 public static function attachLabel($element, $label, $type = self::LABEL_TOP)
 {
     Code::value($type, self::LABEL_TOP, self::LABEL_CHECKBOX);
     if ($label != NULL) {
         $element->templateContent->label = fHTML::label($label, $element)->addClass('\\Psc\\label');
         if ($type == self::LABEL_TOP) {
             $element->templatePrepend('%label%');
             // nicht überschreiben sondern prependen
         }
         if ($type == self::LABEL_CHECKBOX) {
             $element->template = '%self% %label%';
             $element->templateContent->label->addClass('checkbox-label');
         }
     }
     return $element;
 }