Customiser le prototype d'une Collection
Hello tous,
j'essaye d'appliquer le ce que me donne symfony sur le sujet sans succès.
J'ai ma form définie comme ceci :
Code:
1 2 3 4 5 6 7 8
|
->add('ventilations', CollectionType::class, array(
'entry_options' => array( 'compte' => $options['compte']),
'entry_type' => VentilationType::class,
'allow_add' => true,
'allow_delete' => true,
'by_reference' => false
)) |
et dans mon template :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
{% form_theme form.ventilations _self %}
{% block _ventilations_entry_widget %}
<div class="row">
<div class="input-field col s12 l4">
<i class="material-icons prefix">euro_symbol</i>
bouf
<label for="appbundle_operation_ventilations___name___montantDebit">Montant Débit</label>
</div>
<div class="input-field col s12 l4">
<i class="material-icons prefix">euro_symbol</i>
<label for="appbundle_operation_ventilations___name___montantCredit">Montant Credit</label>
</div>
<div class="input-field col s12 l4">
<i class="material-icons prefix">task</i>
<label for="appbundle_operation_ventilations___name___montantCredit">Catégorie</label>
</div>
</div>
{% endblock %}
<div id="modalOperation" class="modal">
<div class="modal-content">
<h4 id="modalCompteTitle">Opération</h4>
<div class="row">
{{ form_start(form, { 'action': path('compte_operation_add', { 'slug':compte.slug } ) ,'method': 'POST', attr : { 'class' : 'col s12', 'id' : 'formOperationVentilation' }}) }}
<div class="row">
<div class="input-field col s12 l3">
<i class="material-icons prefix">today</i>
{{ form_widget(form.date, { 'attr' : { 'class' : 'masked', 'data-inputmask':"'alias': 'date'", 'placeholder' : '' } }) }}
<label for="appbundle_operation_date">Date</label>
</div>
<div class="input-field col s12 l7">
<i class="material-icons prefix">textsms</i>
{{ form_widget(form.libelle) }}
<label for="appbundle_operation_libelle">Libellé</label>
</div>
<div class="input-field col s12 l2">
{{ form_widget(form.estPointe, { 'attr': { 'class' : 'filled-in'}}) }}
<label for="appbundle_operation_estPointe">Pointé</label>
</div>
</div>
<div class="row">
{{ form_widget(form.ventilations) }}
</div>
<div class="row">
<div class="input-filed right-align col s12">
<button type="submit" class="modal-action modal-close waves-effect waves-grey white btn m-b-xs">Enregistrer</button>
</div>
</div>
{{ form_end(form) }}
</div>
</div>
</div> |
Mais rien à faire. Le block "_ventilations_entry_widget" ce met en bas de ma page alors que le rendu "form_widget(form.ventilations)" ce fait sans la customisation (enfin, le prototype !)
Une aide serait la bienvenue pour m'aider à customiser ce prototype !
cdt,