{% if form is defined %} {% set field_value = entity.attributes is defined and entity.attributes is not empty ? entity.attributes|json_encode(constant('JSON_PRETTY_PRINT') b-or constant('JSON_UNESCAPED_UNICODE')) : '{ "example_field": { "type": "string", "label": "Exemple de champ", "required": false, "placeholder": "Entrez une valeur..." } }' %}
{
"field_name": {
"type": "string|select|boolean|date|number|text",
"label": "Libellé affiché",
"required": true|false,
"placeholder": "Texte d'aide (optionnel)",
"options": ["option1", "option2"] // Pour type 'select' uniquement
}
}