Render a given field-value according to the field's definition / formatter within a dataset.
This is shorthand special Version intended to use for Hublify-Angular-Backend-App (NG). Here you do not need to supply the theme-parameter.
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
- $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)
Examples
{{ hublify.formatFieldValue("Hubertus", "firstname", "person" }} => Hubertus {{ hublify.formatFieldValue("2024-12-31 08:15:00", "firstname", "order" }} => 31.12.2025, 08:15