FormValueResolver
Read onlyYes
FinalYes
Resolves form element values to their display representation (e.g. translated labels).
implementation detail of the form finishers and the form value ViewHelpers.
Table of Contents
Methods
- __construct() : mixed
- resolveDisplayValue() : mixed
- Resolves the display value for a single form element.
Methods
__construct()
public
__construct(TranslationService $translationService) : mixed
Parameters
- $translationService : TranslationService
resolveDisplayValue()
Resolves the display value for a single form element.
public
resolveDisplayValue(FormElementInterface $element, mixed $value, FormRuntime $formRuntime) : mixed
Priority:
- ProcessableValueFormElementInterface – element-provided representation (translated select options, country names, formatted dates, …)
- Translated "options" property – generic key-to-label mapping
- Object conversion, which prefers StringableFormElementInterface and falls back to DateTime, File/FileReference and __toString()
- Raw value passthrough for scalars
Parameters
- $element : FormElementInterface
- $value : mixed
- $formRuntime : FormRuntime