{#
component: form
action {string}: Action du formulaire
inputs {array}: tableau d'inputs
buttonText {string}: Texte du bouton d'envoi
information {string}: Texte d'information
mandatory {string}: Texte de champs obligatoires
#}
{% set props = {
action: '',
inputs:null,
buttonText:null,
information:null,
mandatory:null
}|merge(props|default({})) %}
<div data-component="form" class="Form-component">
<form action="{{ props.action }}" autocomplete="false" class="ContactForm-form" method="POST">
{% for message in app.flashes('success') %}
<div class="form-message success" role="alert">
{{ message }}
</div><br>
{% endfor %}
{% for message in app.flashes('error') %}
<div class="form-message error" role="alert">
{{ message }}
</div><br>
{% endfor %}
<br>
{# Inputs #}
<div class="ContactForm-inputs">
{% for item in props.inputs %}
<div class="ContactForm-input {% if item.class is defined and item.class is not null %}{{ item.class }}{% endif %}">
{% include "component/form/input.html.twig" with {
props: item
} %}
</div>
{% endfor %}
<input type="hidden" class="g-recaptcha-response" name="g-recaptcha-response"/>
</div>
{# Submit button #}
<div class="ContactForm-submit">
{% include "component/form/submit.html.twig" with {
props: {
text: props.buttonText,
contactButton:true
}
} %}
</div>
{# Infos #}
{% if props.information is defined and props.information is not null %}
<p class="ContactForm-info">{{ props.information|raw }}</p>
{% endif %}
{# Mandatory fields info #}
{% if props.mandatory is defined and props.mandatory is not null %}
<p class="ContactForm-mandatoryFieldsInfo">{{ props.mandatory }}</p>
{% endif %}
</form>
</div>