symfony2admingenerator / AdmingeneratorGeneratorBundle

(old-legacy) Admingenerator for Symfony2, parse generator.yml files to build classes
http://symfony2admingenerator.org/
MIT License
360 stars 125 forks source link

test if a form row is compound in generate template fieldset.html.twig ? #792

Closed alexbaron closed 9 months ago

alexbaron commented 10 years ago

hello, How can test if a row is a coumpound in the file fieldset.html.twig. This file serve to generate the view :

{% for rows in builder.fieldsets[fieldset] %}
            <div class="row">
            {% for field in rows %}
                {% if builder.Columns[field].credentials %}
                  {{ echo_if_granted(builder.Columns[field].credentials, builder.ModelClass) }}
                {% endif %}
                  {% if  "row is coumpound"%}
                    =====I DO SOMETHING ELSE=====
                  {% else %}  
                  <div class="col-md-4 form_field field_{{ builder.Columns[field].formType }} field_{{ field }}">
                      {{ echo_block("form_" ~ field) }}
                        {{ echo_twig("form_label(form['" ~ field ~ "'])") }}<br/>
                        {{ echo_twig("form_widget(form['" ~ field ~ "'])") }}
                      {{ echo_endblock() }}
                  </div>
{#                  {% endif %}#}
                {% if builder.Columns[field].credentials %}
                    {{ echo_endif () }}
                {% endif %}
            {% endfor %}
            </div>
        {% endfor %}

May be there is another solution ... thanks

sescandell commented 10 years ago

Hi @alexbaron

As far as I remember, there is no such method...

I think you have two ways to make this possible:

Say with other words: PR is welcome :)

Hoping that helps,

alexbaron commented 10 years ago

thanks

PR ! i will try :-)