Get Label Format field from associative array.

@param string        $field Name of a label format field.
@param null|string   $default
@return float|int|mixed|null
187573
public function getValue( $field, $default = null ) {
        if ( array_key_exists($field, $this->defaults) ){
            switch ($this->defaults[$field]['type']) {
                case self::TYPE_INT:
                    return (int) $this->values[$field];
                case self::TYPE_FLOAT:
                    // Round float values to three decimal places and trim trailing zeros.
                    // Add a leading zero to values less than 1.
                    $f = sprintf('%05.3f', $this->values[$field]);
                    $f = rtrim($f, '0');
                    $f = rtrim($f, '.');
                    return (float) (empty($f) ? '0' : $f);
            }
            return $this->values[$field];
        }

        return $default;
    }
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());
    }
1107315
public function get_label($field) {
		return isset($this->labels[$field]) ? $this->labels[$field] : $this->humanize_field_name($field);
	}
1252615
public function getFieldName($defaultName)
    {
        if (is_array($defaultName)) {
            return $this->getFieldNames($defaultName);
        }

        if (isset($this->renamemap[$defaultName])) {
            return $this->renamemap[$defaultName];
        }

        return $defaultName;
    }
318537
public function getFieldType($field)
    {
        // default column type
        $type = $field->type;

        // try to find associated field type
        if (isset($this->type_associations[$type])) {
            $type = $this->type_associations[$type];
        }

        if ($type == 'text' && isset($field->allowHtml) && $field->allowHtml) {
            $type = 'html';
        }

        // if grid column type/formatter explicitly set in model
        if (isset($field->ui['display'])) {
            // @todo this is wrong and obsolete, as hasOne uses display for way different purpose

            $tmp = $field->ui['display'];
            if (isset($tmp['grid'])) {
                $tmp = $tmp['grid'];
            }
            if (is_string($tmp) && $tmp) {
                $type = $tmp;
            }
        }

        return $type;
    }
72152
public function get_attribute($key, $default = null)
	{
		$attributes = $this->get_config('form_attributes', array());

		return array_key_exists($key, $attributes) ? $attributes[$key] : $default;
	}
1163031
public function getValueFromRequest($field, $default = false)
  {
    if (!$element = $this->field($field)) {
      return $default;
    }

    $req = $this->getRequest();
    $input_name = $element->getInputName();

    return $element instanceof Element\File
      ? $req->files->get($input_name, $default, true)
      : $req->get($input_name, $default, true);
  }
178518
public function getAttribute($field, $name, $default = null, $group = null)
    {
        $field = $this->getField($field, $group);

        if ($field) {
            return $field->getAttribute($name, $default);
        }

        return $default;
    }
540510
public static function getField($field)
    {
        return isset(self::$fields[$field]) ? self::$fields[$field] : null;
    }
927365
public function getFieldLabel($fieldName)
    {
        $result = $this->getField($fieldName, 'label_'.$this->locale, $this->getField($fieldName, 'label'));

        if ($result === null && array_key_exists($fieldName, $this->standardFieldLabels)) {
            $result = $this->standardFieldLabels[$fieldName];
        }

        if ($result === null) {
            $result = $fieldName;
        }

        return $result;
    }
176192
private function getFieldType($field): ?string
    {
        if ($field === null) {
            return null;
        }

        $fieldType = gettype($field);
        if ($fieldType === 'object') {
            $classNameArray = explode('\\', get_class($field));
            if (count($classNameArray) === 0) {
                return null;
            }

            $fieldType = mb_strtolower($classNameArray[count($classNameArray) - 1]);
        }

        return $fieldType;
    }
486851
public function get_field_raw( $field ) {
		if ( array_key_exists( $field, $this->prop( 'fields' ) ) ) {
			return $this->prop( 'fields' )[ $field ];
		}

		return null;
	}
260264
public static function formatter(Field $field)
    {
        $result = '';
        $options = [];

        if (!empty($field->metadata->settings['options'])) {
            foreach (explode("\n", $field->metadata->settings['options']) as $option) {
                $option = explode('|', $option);
                $value = $option[0];
                $label = isset($option[1]) ? $option[1] : $option[0];
                $options[$value] = $label;
            }
        }

        if (is_string($field->extra)) {
            $selectedOptions = [$field->extra];
        } else {
            $selectedOptions = (array)$field->extra;
        }

        foreach ($selectedOptions as $key) {
            switch ($field->viewModeSettings['formatter']) {
                case 'key':
                    $result .= "{$key}<br />";
                    break;

                case 'default':
                default:
                    if (!empty($options[$key])) {
                        $result .= "{$options[$key]}<br />";
                    }
                    break;
            }
        }

        return $result;
    }
1196340
public function parseField($field = null,$default = '')
	{
		if(null === $field)
		{
			if(isset($this->operationOption['field']))
			{
				$field = $this->operationOption['field'];
			}
			else
			{
				return $default . ' ';
			}
		}
		$result = '';
		foreach($field as $tField)
		{
			if(is_array($tField))
			{
				foreach($tField as $key => $value)
				{
					if(is_numeric($key))
					{
						$result .= $this->parseKeyword($value) . ',';
					}
					else
					{
						$result .= $this->parseKeyword($key) . ' as ' . $this->parseKeyword($value) . ',';
					}
				}
			}
			else
			{
				$result .= $tField . ',';
			}
		}
		return isset($result[1]) ? (substr($result,0,-1) . ' ') : '';
	}
1345333
function field($label, $fieldname, $fieldtype) {
		// field type loaders
		$fieldtypes = $this->confs->read('ran/htmlform')['fieldtypes'];

		if (isset($fieldtypes[$fieldtype])) {
			$instance = $fieldtypes[$fieldtype]($this, $this->confs);
		}
		else { # assume specialized class definition with no fieldtype loader
			$class = \hlin\PHP::pnn('ran.'.ucfirst($fieldtype).'Field');
			$instance = $class::instance($this->confs);
		}

		// configure and return
		return $instance
			->set('id', $this->signature($this->fieldcounter++))
			->set('name', $fieldname)
			->form_is($this)
			->fieldlabel_is($label)
			->fieldtemplate_is($this->fieldtemplate($fieldtype))
			->fieldconfigurer_is($this->fieldconfigurer($fieldtype))
			->hintrenderer_is($this->hintrenderer($fieldtype))
			->errorrenderer_is($this->errorrenderer($fieldtype))
			->adderrors($this->errors($fieldname));
	}
106122
public function getData($field=null,$default=null){
        if(is_null($field)){
            return $this->data;
        }
        $tmp=$this->data;
        foreach(explode(".",$field) as $f){
            if(!isset($tmp[$f])){
                return $default;
            }
            $tmp=$tmp[$f];
        }
        return $tmp;
    }
94519
public static function adminFormFieldLabel($field) {

        // Does the field have an alternate name?
        $name = $field['name'];

        if (!empty($field['alternate_form_name'])) {
            $name = $field['alternate_form_name'];
        } 

        if ($name == "id") return "ID";

        $html = str_replace("_", " ", $name);
        $html = ucwords($html);
        return $html;
    }