FormValueResolver

final readonly class \TYPO3\CMS\Form\Service\FormValueResolver

Resolves form element values to their display representation (e.g. translated labels).

Table of Contents

Methods

__construct()  : mixed
resolveDisplayValue()  : mixed
Resolves the display value for a single form element.

Methods

resolveDisplayValue()

Resolves the display value for a single form element.

public resolveDisplayValue(FormElementInterface $element, mixed $value, FormRuntime $formRuntime) : mixed

Priority:

  1. ProcessableValueFormElementInterface – element-provided representation (translated select options, country names, formatted dates, …)
  2. Translated "options" property – generic key-to-label mapping
  3. Object conversion, which prefers StringableFormElementInterface and falls back to DateTime, File/FileReference and __toString()
  4. Raw value passthrough for scalars

Parameters

$element : FormElementInterface
$value : mixed
$formRuntime : FormRuntime
On this page