Formats the given field.

@param \Field\Model\Entity\Field $field The field being rendered
@return string
12418
public static function formatter(Field $field)
    {
        $viewModeSettings = $field->viewModeSettings;
        $processing = $field->metadata->settings['text_processing'];
        $formatter = $viewModeSettings['formatter'];
        $content = static::process($field->value, $processing);

        switch ($formatter) {
            case 'plain':
                $content = static::filterText($content);
                break;

            case 'trimmed':
                $len = $viewModeSettings['trim_length'];
                $content = static::trimmer($content, $len);
                break;
        }

        return $content;
    }
350920
protected function guessPluralField($entity, $field = null)
    {
        return $field ?: Inflector::pluralize($this->guessSingularField($entity));
    }
51326
protected function formatFieldList($fields) {
		if( !is_array($fields) ) {
			return $fields;
		}
		$string	= '';
		foreach( $fields as $key => $value ) {
			$string .= ($string ? ', ' : '').$this->escapeIdentifier($key).'='.$this->formatValue($value);
		}
		return $string;
	}
481399
protected function renderFieldset(array $field)
    {
        $output = '';
        $output .= $this->fieldsetBegin($field);
        $output .= $this->renderFields($field['fields']);
        $output .= $this->fieldsetEnd($field);
        return $output;
    }
1158122
protected function _deriveFieldFromContext($field)
    {
        $controller = $this->_controller();
        $entity = $this->_entity();
        $request = $this->_request();
        $value = $entity->get($field);

        if ($value) {
            return $value;
        }

        $path = "{$controller->modelClass}.{$field}";
        if (!empty($request->getData())) {
            $value = Hash::get((array)$request->getData(), $path);
        }

        $singularVar = Inflector::variable($controller->modelClass);
        if (!empty($controller->viewVars[$singularVar])) {
            $value = $entity->get($field);
        }

        return $value;
    }
448929
public function getValFormatted($field)
    {
        if ($this->validate($field)) {
            $value = $field->valRaw();
            $dateArray = $this->getDateArray($value);
            return \sprintf('%04d-%02d-%02d', $dateArray['year'], $dateArray['mon'], $dateArray['mday']);
        }
        return null;
    }
549871
function render_field( $field ) {

		$maxrows = null;

		$disablesort = null;

		$defaultheaders = null;


		// vars
		$o = array( 'id', 'name' );
		$s = array( 'readonly', 'disabled' );
		$e = '';


		// maxlength
		if( $field['maxrows'] !== '' ) {

			$maxrows = 'data-maxrows="'.$field['maxrows'].'"';

		}

						// disable sort
		if( !empty($field['disable_sort']) ) $disablesort = ' data-disablesort="'.$field['disable_sort'].'"';

		// rows
		if( !empty($field['fixed_columns']) ) {

			$defaultheaders = preg_split( '/\r\n|\r|\n/',  $field['default_headers'] );

			$defaultheaders = 'data-defaultheaders="'.implode(",", $defaultheaders) .'"';
			if( empty($field['default_headers']) ) $defaultheaders = 'data-defaultheaders="No Default Headers Set"';

		}




		// populate atts
		$atts = array();
		foreach( $o as $k ) {

			$atts[ $k ] = $field[ $k ];

		}



		// special atts
		foreach( $s as $k ) {

			if( $field[ $k ] ) {

				$atts[ $k ] = $k;

			}

		}



		$e .= '<textarea style="display:none" '.$maxrows.' '.$disablesort.' '.$defaultheaders.' data-key="'.$field['key'].'" ' . acf_esc_attr( $atts ) . ' >';
		$e .= esc_textarea( $field['value'] );
		$e .= '</textarea>';


		// return
		echo $e;

	}
916337
public function render(FileField $field)
	{
		$required = null;

		if($field->hasRule('ch\metanet\formHandler\rule\RequiredRule'))
			$required = ' aria-required="true"';
		
		if($this->numberOfFiles <= 1)
			return '<input type="file" name="' . $field->getFormIdentifierAsString() . '" id="' . $field->getId() . '" ' . $this->getAttributesAsHtml() . $required . '>';
		
		$field->setLinkedLabel(false);
		
		$html = '<ul' . $this->getAttributesAsHtml() . '>';
		
		for($i = 0; $i < $this->numberOfFiles; $i++) {
			$html .= '<li><input type="file" name="' . $field->getFormIdentifierAsString() . '[]" id="' . $field->getId() . '-' . $i . '" ' . ($i === 0 ? $required : null) . '></li>';
		}
		
		$html .= '</ul>';
		
		return $html;
	}
1153509
public function getRelativePath($entity, $field)
    {
        if (is_object($entity)) {
            $entity = get_class($entity);
        }
        $entity = strtolower(Str::classname($entity));

        return $entity . '/' . $field;
    }
1241594
public static function formatter($view, $field)
    {
        switch ($field->viewModeSettings['formatter']) {
            case 'link':
                $out = $view->element('Field.FileField/display_link', compact('field'));
                break;
            case 'table':
                $out = $view->element('Field.FileField/display_table', compact('field'));
                break;
            case 'url':
            default:
                $out = $view->element('Field.FileField/display_url', compact('field'));
                break;
        }

        return $out;
    }
797593
public function map(Field $field)
    {
        $values = array();

        foreach ((array)$field->value as $value) {
            $values[] = $this->convert($value);
        }

        return $values;
    }
444643
public static function generateLabel($field)
    {
        $label = Str::title(str_replace('_', ' ', $field['fieldName']));
        $template = "{!! Form::label('\$FIELD_NAME\$', '\$FIELD_NAME_TITLE\$:', ['class' => 'form-control-label $FIELD_NAME_TITLE$']) !!}";
        $template = str_replace('$FIELD_NAME_TITLE$', $label, $template);
        $template = str_replace('$FIELD_NAME$', $field['fieldName'], $template);
        return $template;
    }
855545
private function getFieldName(string $field): string
    {
        if (preg_match('/^:/', $field)) {
            return str_replace(':', '', $field);
        }

        if (false === strpos($field, '.')) {
            return $this->tableAlias . '.' . $field;
        }

        return $field;
    }
4510
public function format_float($field)
    {
        $precision = 2;
        $m = (float) $this->current_row[$field];
        $this->current_row[$field] =
            is_null($this->current_row[$field])
                ? '-'
                : number_format($m, $precision);
        $this->setTDParam($field, 'align', 'right');
        $this->setTDParam($field, 'style/white-space', 'nowrap');
    }
819093
protected function getFieldItem(Field $field)
    {
        if ($field->hasForeignRelation()) {
            $relation = $field->getForeignRelation();

            return sprintf('$%s', $relation->getSingleName());
        }

        return '$text';
    }
1339932
public function getField(string $field) : string
        {
                $value = $this->_redis->hget($this->_key, $field);
                return empty($value) ? '' : strval($value);
        }
956110
public function formatFieldsWithFieldAlias($table_alias = null)
    {
        $fields = $this->getFieldsWithTableAlias($table_alias);

        return join(
            ', ',
            array_map(
                function ($field_alias, $field_definition) {
                    return sprintf(
                        '%s as "%s"',
                        $field_definition,
                        addcslashes($field_alias, '"\\')
                    );
                },
                array_keys($fields),
                $fields
            )
        );
    }