library/core/class.form.php
public function Label($TranslationCode, $FieldName = '', $Attributes = FALSE) {
      // Assume we always want a 'for' attribute because it's Good & Proper.
      // Precedence: 'for' attribute, 'id' attribute, $FieldName, $TranslationCode
      $DefaultFor = ($FieldName == '') ? $TranslationCode : $FieldName;
      $For = ArrayValueI('for', $Attributes, ArrayValueI('id', $Attributes, $this->EscapeID($DefaultFor, FALSE)));

      return '<label for="' . $For . '"' . $this->_AttributesToString($Attributes).'>' . T($TranslationCode) . "</label>\n";
   }
public function Label($TranslationCode, $FieldName = '', $Attributes = FALSE) {
      // Assume we always want a 'for' attribute because it's Good & Proper.
      // Precedence: 'for' attribute, 'id' attribute, $FieldName, $TranslationCode
      $DefaultFor = ($FieldName == '') ? $TranslationCode : $FieldName;
      $For = ArrayValueI('for', $Attributes, ArrayValueI('id', $Attributes, $this->EscapeID($DefaultFor, FALSE)));

      return '<label for="' . $For . '"' . $this->_AttributesToString($Attributes).'>' . T($TranslationCode) . "</label>\n";
   }
public function Label ( $ TranslationCode , $ FieldName = '' , $ Attributes = FALSE ) { // Assume we always want a 'for' attribute because it's Good & Proper. // Precedence: 'for' attribute, 'id' attribute, $FieldName, $TranslationCode $ DefaultFor = ( $ FieldName == '' ) ? $ TranslationCode : $ FieldName ; $ For = ArrayValueI ( 'for' , $ Attributes , ArrayValueI ( 'id' , $ Attributes , $ this -> EscapeID ( $ DefaultFor , FALSE ) ) ) ; return '<label for="' . $ For . '"' . $ this -> _AttributesToString ( $ Attributes ) . '>' . T ( $ TranslationCode ) . "</label>\n" ; }
Returns XHTML for a label element.

@param string $TranslationCode Code to be translated and presented within the label tag.
@param string $FieldName Name of the field that the label is for.
@param array $Attributes Associative array of attributes for the input that the label is for.
This is only available in case the related input has a custom id specified in the attributes array.

@return string
Returns XHTML for a label element .