Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to display multiple informations of another entity in the same form?
    text
    copied!<p>Actually, I try to create a form on middle entity and I want to display many input for the same entity (project color and project name). I would be able to create the project entity too.</p> <pre><code># MyNiceBundle/Form/Type/CollaborationType.php public function buildForm(FormBuilder $builder, array $options) { $builder-&gt;add('project', 'entity', array( 'class' =&gt; 'MyNiceBundle:Project', 'property' =&gt; 'name' )); $builder-&gt;add('project', 'entity', array( 'class' =&gt; 'MyNiceBundle:Project', 'property' =&gt; 'color' )); $builder-&gt;add('participant', 'entity', array( 'class' =&gt; 'MyNiceBundle:User', 'property' =&gt; 'email', 'multiple' =&gt; true, 'expanded' =&gt; true )); $builder-&gt;add('workgroup', 'entity', array( 'class' =&gt; 'MyNiceBundle:Workgroup', 'property' =&gt; 'name', 'multiple' =&gt; false, 'expanded' =&gt; true )); } # Resources/Views/project_form.html.twig &lt;form id="project-creation" class="form" action="{{ path('nicebundle_project_create') }}" method="post"&gt; {{ form_errors(form) }} &lt;div class="project"&gt; # Here I want to show the input for project name {{ form_errors(form.project) }} {{ form_widget(form.project) }} &lt;/div&gt; &lt;div id="navigation-panel"&gt; # Here I want to show the input for project color {{ form_errors(form.project) }} {{ form_widget(form.project) }} {{ form_errors(form.participant) }} {{ form_widget(form.workgroup) }} {{ form_widget(form._token) }} &lt;input class="btn" type="reset" value="reset" /&gt; &lt;input class="btn" type="submit" value="submit" /&gt; &lt;/div&gt; &lt;/form&gt; </code></pre> <p>What should I do?</p> <p>Thanks in advance.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload