Widze ze field_row to jest to samo co form_row i ze to pierwsze od wersji 2.3 nie powinno w ogole istniec.
Ja formularz generuje tak:
Kod
<form id="{{ formName }}" class="" action="{{ path('cms_configuration', {'group': id}) }}" method="post" {{ form_enctype(form) }}>
{% for f in form.items %}
{{ form_widget(f) }}
{% endfor %}
{{ form_widget(form._token) }}
{{ form_rest(form) }}
<div class="submit-button horizontalCenteredWrapper">
<div class="horizontalCenteredContainer">
<input type="submit" value="Zapisz" class="submit" />
</div>
</div>
</form>
Czy w petli tez mozna zrobic taki zabieg?
Ok tak wyglada rozwiazanie:
{% extends ['MeritooBackendCmsBundle::layout.html.twig', '::layout.html.twig'] %}
<form id="{{ formName }}" class="" action="{{ path('cms_configuration', {'group': id}) }}" method="post" {{ form_enctype(form) }}> {% for f in form.items %}
{% block field_row %}
{% spaceless %}
{{ form_widget(f) }}
{% endspaceless %}
{% endblock field_row %}
{% endfor %}
{{ form_widget(form._token) }}
{{ form_rest(form) }}
<div class="submit-button horizontalCenteredWrapper"> <div class="horizontalCenteredContainer"> <input type="submit" value="Zapisz" class="submit" />
Mam jeszcze jedno pytanie mam modul konfiguracji w CMS zaleznie od pola mamy rozne pola dla opcji dziala wszystkie oprocz 2.
Choice checkbox/multiple menu
Gdy zrobie tak(to jest przyklad):
$builder->add('value', 'choice', array (
'label' => $this->item->getTitle() . ':',
'choices' => array('1' => 'jeden', '2' => 'dwa'), 'multiple' => true,
'expanded' => true,
)
);
Wywala mi:
Cytat
Expected argument of type "array", "string" given
Wtf?Szukam tak szczerze od kilku dni, to jest ostatnia poprawka jaka musze zrobic i jedyna ktorej nie potrafie zrobic
http://symfony.com/doc/current/reference/f...pes/choice.html a przeciez wszystko robie dobrze!
P.S
Taki sam mam blad gdy multiple = true expanded = false (multiple menu) a dla checkbox/menu dziala...