title: Create a Symfony/Twig Form with data from the database
body: <p>I have a simple table with 3 columns with some (&lt;10) rows.</p>
  
  <p>Table:</p>
  
  <pre><code>/**
   * @ORM\Entity
   * @ORM\Table(name="property_addition_cost_frequency")
   */
  class PropertyAdditionCostFrequency
  {
      /**
       * @ORM\Id
       * @ORM\GeneratedValue(strategy="AUTO")
       * @ORM\Column(type="integer")
       */private $id;
  
      /**
       * @ORM\Column(type="string")
       */
      private $label;
  
      /**
       * @ORM\Column(type="string")
       */
      private $group;
  
      /**
       * @ORM\Column(type="string")
       */
      private $active;
      //all getters and setters
  }
  </code></pre>
  
  <p>I have a working code for showing 1 row in a prefilled form.</p>
  
  <p>AdminCoreDataController.php</p>
  
  <pre><code>/**
   * @Route("/core_data/{id}", defaults={"id" = 1}, name="admin_core_data")
   */
  public function showCoreDataListAction( Request $request, PropertyAdditionCostFrequency $propertyAdditionCostFrequency )
  {
      $form = $this-&gt;createForm( PropertyAdditionCostFrequencyForm::class, $propertyAdditionCostFrequency);
      $form-&gt;handleRequest($request);
  
      if($form-&gt;isSubmitted() &amp;&amp; $form-&gt;isValid()){
          $propertyAdditionCostFrequency  = $form-&gt;getData();
          $em = $this-&gt;getDoctrine()-&gt;getManager();
          $em-&gt;persist($propertyAdditionCostFrequency);
          $em-&gt;flush();
          $this-&gt;addFlash('success', 'successfully changed the data');
          return $this-&gt;redirectToRoute('admin_property_list');
      }
  
      return $this-&gt;render('logged_in/content/admin/core_data/core_data.html.twig', [
          'propertyCostFrequencyForm' =&gt; $form-&gt;createView()
      ]);
  }
  </code></pre>
  
  <p>core_data.html.twig</p>
  
  <pre><code>{{ form_start(propertyCostFrequencyForm) }}
      {{ form_widget(propertyCostFrequencyForm.label) }}
      {{ form_widget(propertyCostFrequencyForm.active) }}
      &lt;button type="submit"&gt;send&lt;/button&gt;
  {{ form_end(propertyCostFrequencyForm) }}
  </code></pre>
  
  <p>PropertyAdditionCostFrequencyForm.php</p>
  
  <pre><code>public function buildForm(FormBuilderInterface $builder, array $options)
  {
      $builder
          -&gt;add(  'label' )
          -&gt;add(  'active' )
      ;
  }
  </code></pre>
  
  <p>How can I get a form with all rows from the table if no "id" is given?</p>