Render a given field-value according to the field's definition / formatter within a dataset.
The actual used "formatter"-twig-template is looked up in the "theme"-folder.
Syntax
formatFieldValue(mixed $value, ?string $field, ?string $dataset, ?array $data = null, ?array $opts = null, ?string $theme = null): ?string
- $value - mixed
The value to format (render). - $field- string
The field-label the $value belongs to. From the corresponding Field-Definition all the type-/formatter-configurations are looked up and used.
$dataset - string
The Hublify dataset-label the $field belongs to.- $data - array (optional)
Besides $value you can / should pass any available data-record-values as well. In case the formatter-template needs these for rendering. - $opts - array (optional)
- $theme - string (optional, default NULL)
"hfyng" - Formatter-Templates are used from "@hublify/..../field" directory
Examples
{{ hublify.formatFieldValue("Hubertus", "firstname", "person" }} => Hubertus {{ hublify.formatFieldValue("2024-12-31 08:15:00", "firstname", "order" }} => 31.12.2025, 08:15