{% set container_class = container_class ?? null %}{% set label = label ?? null %}{% set emptyLabel = emptyLabel ?? false %}{% set label_attr = label_attr ?? [] %}{% set widgetContainer = widgetContainer ?? '' %}{% set type = type ?? 'text' %}{% set value = value ?? false %}{% set no_label = no_label ?? false %}{% set required = required ?? true %}{% set readOnly = readOnly ?? false %}{% set error_message = error_message ?? 'Ce champ est obligatoire.' %}{% set success_message = success_message ?? '' %}{% set help_message = help_message ?? false %}{% set prefix = prefix ?? false %}{% set dataUnit = dataUnit ?? false %}{# input attribute attributes #}{% set attr = { 'class': null, 'placeholder': null, 'readonly': readOnly,}|merge(attr ?? {}) %}{% set name = name ?? null %}{% if container_class %} <div class="{{ container_class }}">{% endif %} {% if field is defined and field is not null %} {% set label = label ?? field.vars.label %} {% set attr = attr|merge(field.vars.attr) %} {% set label_attr = label_attr|merge(field.vars.label_attr) %} {% if label %} {{ form_label(field, label, {'label_attr': label_attr}) }} {% elseif emptyLabel %} <div class="input-label"> </div> {% endif %} <div class="is-relative {{ widgetContainer }}"> {{ form_widget(field, {'attr': attr}) }} {% if attr["data-unite"] is defined %} <div class="input-unit js-class-for-consultation-input">{{attr["data-unite"]}}</div> {% endif %} </div> {% if required %} <small class="form-error">{{ error_message }}</small> {% endif %} {% if help_message %} <span class="form-help">{{ help_message }}</span> {% endif %} {{ form_errors(field) }} {% else %} {% if label %} <label for="{{ id }}" class="{{ label_attr.class }}">{{ label }}</label> {% endif %} <input id="{{ id }}" type="{{ type }}" class="input {{ attr.class }}" name="{{ name }}" {% if attr.placeholder %} placeholder="{{ attr.placeholder }}" {% endif %} {% if attr.pattern ?? false %} pattern="{{ attr.pattern }}" {% endif %} {% if value %} value="{{ value }}" {% endif %} {% if required %} required {% endif %} {# {% if dataUnit %} data-unit = "{{dataUnit}}" {% endif %} #} > {% if required %} <small class="form-error">{{ error_message }}</small> {% endif %} {% if atrr["data-unite"] is defined %} <div>test</div> {% endif %} {% if help_message %} <span class="form-help">{{ help_message }}</span> {% endif %} {% endif %}{% if container_class %} </div>{% endif %}