Korzystam na co dzien z paneli CRUD. W jaki sposob to zrobic?
Moj custom form dla pojedynczego produktu wyglada mniej wiecej tak:
... {{ form_row(form.priceNetto, { 'label' : 'Cena netto' }) }} {{ form_row(form.priceBrutto, { 'label' : 'Cena brutto' }) }} ... {{ form_rest(form) }}
Lista produktow w pliku index.html.twig wygenerowanym przez SF2 zas mniej wiecej tak:
{% for entity in entities %} {% if entity.isActive == 0 %} <tr class="warning"> {% else %} <tr> {% endif %} <td> {# {% if entity.images is not empty %} #} {% for image in entity.images %} {% if loop.first %} {% if image.filename and image.isActive %}<a class="fancybox" href="{{ asset(imgPath) }}{{ entity.slug }}/{{ image.filename }}"> {% elseif image.filename is empty %}<img class="img-responsive thumbnail center-block" src="{{ asset(imgPath) }}{{ noImg }}" width="50" height="50" title="{{ image.title }}" alt="{{ image.alt }}" />{% endif %} {% endif %} {% endfor %} {# {% elseif entity.images is empty %} <img class="img-responsive thumbnail center-block" src="{{ asset(imgPath) }}{{ noImg }}" width="50" height="50" title="{{ image.title }}" alt="{{ image.alt }}" /> {% endif %} #} </td> <td> {% if entity.categories is not empty %} {% for category in entity.categories %} {% endfor %} {% elseif entity.categories is empty %} {% endif %} </td> <td>{% if entity.isActive == 1 %}<img src="{{ asset(iconsPath) }}/{{ iconTickYES }}" data-toggle="tooltip" data-placement="top" title="Opublikowano" alt="Opublikowano" />{% elseif entity.isActive == 0 %}<img src="{{ asset(iconsPath) }}/{{ iconTickNO }}" data-toggle="tooltip" data-placement="top" title="Nie opublikowano" alt="Nie opublikowano" />{% endif %}</td> <td>{% if entity.isNew == '1' %}<img src="{{ asset(iconsPath) }}/{{ iconYES }}" data-toggle="tooltip" data-placement="top" title="Tak" alt="Tak" />{% elseif entity.isNew == '0' %}<img src="{{ asset(iconsPath) }}/{{ iconNO }}" data-toggle="tooltip" data-placement="top" title="Nie" alt="Nie" />{% endif %}</td> <td>{% if entity.isPromo == '1' %}<img src="{{ asset(iconsPath) }}/{{ iconYES }}" data-toggle="tooltip" data-placement="top" title="Tak" alt="Tak" />{% elseif entity.isPromo == '0' %}<img src="{{ asset(iconsPath) }}/{{ iconNO }}" data-toggle="tooltip" data-placement="top" title="Nie" alt="Nie" />{% endif %}</td> <td>{% if entity.isPopular == '1' %}<img src="{{ asset(iconsPath) }}/{{ iconYES }}" data-toggle="tooltip" data-placement="top" title="Tak" alt="Tak" />{% elseif entity.isPopular == '0' %}<img src="{{ asset(iconsPath) }}/{{ iconNO }}" data-toggle="tooltip" data-placement="top" title="Nie" alt="Nie" />{% endif %}</td> <td class="hidden-print"> <div class="text-center"> </div> </td> </tr> {% endfor %}
Prosze o jakas podpowiedz.
Byc moze nie nakreslilem jasno swoich oczekiwan, co do formularza.
Widzialbym go jako podobny do tego z ponizszego zdjecia:
