Get the label HTML for a field
@param string $field_key
@param mixed $required_mark Pass null if you don't want required fields to be marked
@return string
349113
public function getRenderLabel($field_key, $required_mark = ' <span class="required">*</span>')
    {
        return sprintf(
            '<label for="%s">%s%s</label>',
            $field_key,
            $this->getLabelText($field_key),
            ($required_mark && $this->isRequired($field_key)) ? $required_mark : null
        );
    }
766856
public function tag($key, $default = '')
    {
        if (!($values = $this->get($key, $default))) {
            return '';
        }

        if (!is_array($values)) {
            $values = [$values];
        }

        $html = '';

        foreach ($this->config['tags'] as $tag) {
            $class = __NAMESPACE__.'\\Tags\\'.$tag;

            foreach ($values as $value) {
                $html .= $class::tag($key, $value);
            }
        }

        return $html;
    }
275029
public function render(): string
    {
        $elementKey = $this->arguments['elementKey'];
        $fieldKey = $this->arguments['fieldKey'];
        $field = $this->arguments['field'];
        $table = $this->arguments['table'];

        $this->fieldHelper = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('MASK\\Mask\\Helper\\FieldHelper');
        // if we have the whole field configuration
        if ($field) {
            // check if this field is in an repeating field
            if ($field["inlineParent"]) {
                // if yes, the label is in the configuration
                $label = $field["label"];
            } else {
                // otherwise the type can only be tt_content or pages
                if ($table) {
                    // if we have table param, the type must be the table
                    $type = $table;
                } else {
                    // otherwise try to get the label, set param $excludeInlineFields to true
                    $type = $this->fieldHelper->getFieldType($fieldKey, $elementKey, true);
                }
                $label = $this->fieldHelper->getLabel($elementKey, $fieldKey, $type);
            }
        } else {
            // if we don't have the field configuration, try the best to fetch the type and the correct label
            $type = $this->fieldHelper->getFieldType($fieldKey, $elementKey, false);
            $label = $this->fieldHelper->getLabel($elementKey, $fieldKey, $type);
        }
        return $label;
    }
1371544
@SuppressWarnings("unchecked")
    public <T> FieldFormatter<T> getFormatter(final Class<T> requiredType) {
        return (FieldFormatter<T>)typeMap.get(requiredType);
    }
29144
def _get_field_info(self, field, filter_rel_field, page=None, page_size=None):
        
        ret = dict()
        ret["name"] = field.name
        ret["label"] = self.label_columns.get(field.name, "")
        ret["description"] = self.description_columns.get(field.name, "")
        # Handles related fields
        if isinstance(field, Related) or isinstance(field, RelatedList):
            ret["count"], ret["values"] = self._get_list_related_field(
                field, filter_rel_field, page=page, page_size=page_size
            )
        if field.validate and isinstance(field.validate, list):
            ret["validate"] = [str(v) for v in field.validate]
        elif field.validate:
            ret["validate"] = [str(field.validate)]
        ret["type"] = field.__class__.__name__
        ret["required"] = field.required
        ret["unique"] = field.unique
        return ret
601
def get_field_label(self, field_name, field=None):
        
        label = None
        if field is not None:
            label = getattr(field, 'verbose_name', None)
            if label is None:
                label = getattr(field, 'name', None)
        if label is None:
            label = field_name
        return label.capitalize()
751363
protected function getLabelFromField(Field $field = null)
    {
        if (empty($field)) {
            return $this->getStubContent('form-nolabel-field.blade', $this->template);
        }

        return $this->getLabelElement($field->name, $field->getLabel());
    }
247232
private function get_cta(
            $label,
            $is_primary = true,
            $is_disabled = false,
            $href = '',
            $target = '_blank'
        ) {
            $classes = array();

            if ( ! $is_primary ) {
                $classes[] = 'left';
            } else {
                $classes[] = 'button-primary';
                $classes[] = 'right';
            }

            if ( $is_disabled ) {
                $classes[] = 'disabled';
            }

            return sprintf(
                '<a %s class="button %s">%s</a>',
                empty( $href ) ? '' : 'href="' . $href . '" target="' . $target . '"',
                implode( ' ', $classes ),
                $label
            );
        }
942134
private static function buildWrapper($field, $name, $label = '', $checkbox = false, $required)
        {
            $getter = 'get' . Inflector::camelize($name);
            $error = null;
            $actual = Session::instance('ThinForm')->getActual();

            if (null !== $actual) {
                $error = $actual->getErrors()->$getter();
            }

            $class = 'control-group';

            if (!empty(static::$controlGroupError) && !empty($error)) {
                $class .= ' ' . static::$controlGroupError;
            }

            $id = ' id="control-group-' . $name . '"';
            $out = '<div class="' . $class . '"' . $id . '>';
            $out .= static::buildLabel($name, $label, $required);
            $out .= '<div class="controls">' . PHP_EOL;
            $out .= ($checkbox === true) ? '<label class="checkbox">' : '';
            $out .= $field;

            if (!empty($error)) {
                $out .= '<span class="help-inline">' . $error . '</span>';
            }

            $out .= ($checkbox === true) ? '</label>' : '';
            $out .= '</div>';
            $out .= '</div>' . PHP_EOL;

            return $out;
        }
783889
function Postmark(keys){
  if (!keys) return
  this.name = "postmark"
  this.keys = keys

  this.initialize = function() {
    var postmark = require("postmark")
    this.client = new postmark.Client(this.keys.server_key);
  }

  this.send = function(data, callback) {
    var context = this;
    var emailData = {
      "From": data.from || this.keys.from_email, 
      "To": data.to, 
      "Subject": data.subject, 
      "HTMLBody": data.message
    };

    // Validate from email
    var fromObj = validateFromEmail(emailData.From);
    if (!fromObj.valid) return callback(new PostmarkUserStatus(fromObj.message, fromObj.statusCode));

    this.client.sendEmail(emailData, function(err, result) {
        var postmarkStat;
        if(err) {
          postmarkStat = new PostmarkErrorStatus(err);
          debug("-_-_ FAILED with postmark _-_-");
          debug(postmarkStat);
          return callback(postmarkStat);
        }
        else {
          postmarkStat = new PostmarkSuccessStatus(result);
          debug("-_-_ sent with postmark _-_-");
          result.service = context;
          result.status = postmarkStat;
          debug(result);
          return callback(null, result);
        }
    });
  }

  this.initialize()
}
442589
public function editMarkAction(Request $request, Mark $mark)
    {
        $this->assertCanEdit($mark->getResult());
        $newValue = $request->request->get('value', false);
        $response = new JsonResponse();

        if ($newValue !== false) {
            if (!$this->manager->isValidMark($mark->getResult(), $newValue)) {
                $response->setData('Mark is not valid');
                $response->setStatusCode(422);
            } else {
                $this->manager->updateMark($mark, $newValue);
                $response->setStatusCode(204);
            }
        } else {
            $response->setData('Field "value" is missing');
            $response->setStatusCode(422);
        }

        return $response;
    }
236600
protected function __getLabelMetaString()
    {
        $strOutput = "";

        if (is_array($this->__labelmeta)) {
            foreach ($this->__labelmeta as $key => $value) {
                if (! in_array($key, $this->__reservedmeta)) {
                    $strOutput .= " {$key}=\"{$value}\"";
                }
            }
        }

        return $strOutput;
    }
712625
protected function getColumnIndex($field, string $error_message)
    {
        $method = is_string($field) ? 'getColumnIndexByValue' : 'getColumnIndexByKey';

        return $this->$method($field, $error_message);
    }
324205
protected function getHtmlPrefixLabel(): string
  {
    // If a label must be generated make sure the form control and the label have matching 'id' and 'for' attributes.
    if (isset($this->labelPosition))
    {
      if (!isset($this->attributes['id']))
      {
        $id                           = Html::getAutoId();
        $this->attributes['id']       = $id;
        $this->labelAttributes['for'] = $id;
      }
      else
      {
        $this->labelAttributes['for'] = $this->attributes['id'];
      }
    }

    // Generate a prefix label, if required.
    if ($this->labelPosition=='pre')
    {
      $ret = $this->getHtmlLabel();
    }
    else
    {
      $ret = '';
    }

    return $ret;
  }
1156672
public String getStringTag(String key) {
		Object value = tags.get(key);
		if (value instanceof String) {
			return (String) value;
		}
		return null;
	}
592327
public function markRequired($elTpl, $required)
    {
        if ($required) {
            $this->hasRequired = true;
            $elTpl = str_replace(array('<qf:required>', '</qf:required>'),
                                  array('', ''), $elTpl);
        } else {
            $elTpl = preg_replace('!<qf:required>.*</qf:required>!isU', '', $elTpl);
        }
        return $elTpl;
    }
1058601
public function closeTag()
    {
        $result = '</label>';
        if ($this->element->hasAttribute('required') && $this->element->getAttribute('required')) {
            $result = sprintf('<span class="required-mark">*</span> %s', $result);
        }

        return $result;
    }