title: Symfony 3.4 : Render multiple array in twig
body: <p>I got a form with CollectionType that stores an array in an SQLite database, this is  the structure of the entity object returned in the controller:</p>
  
  <pre><code>Expertations {#666 ▼
  -id: 9
    -date: DateTime @1536749818 {#653 ▶}
    -client: 1
    -status: 0
    -price: 0.0
    -expiration: DateTime @1536749818 {#650 ▶}
    -tipo: 1
    -kw: 12
    -piani_casa: 2
    -riscaldamento: "1"
    -opere_murarie: false
    -trifase: false
    -sconto: 10.0
    -level: 1
    -square_meters: 140
    -floor: array:6 [▼
      0 =&gt; 1
      1 =&gt; 1
      2 =&gt; 2
      3 =&gt; 2
      4 =&gt; 2
      5 =&gt; 2
    ]
    -ambient: array:6 [▼
      0 =&gt; Rooms {#671 ▼
        -id: 10
        -name: "Cucina"
        -level: 1
        -sq_meter_from: 0.0
        -sq_meter_to: 999.0
        -punti_prese: 5
        -punti_luce: 1
        -prese_tv: 1
      }
      1 =&gt; Rooms {#649 ▶}
      2 =&gt; Rooms {#670 ▶}
      3 =&gt; Rooms {#669 ▶}
      4 =&gt; Rooms {#649 ▶}
      5 =&gt; Rooms {#668 ▶}
    ]
    -name: array:6 [▼
      0 =&gt; "Cucina"
      1 =&gt; "Soggiorno"
      2 =&gt; "Corridoio"
      3 =&gt; "Camera Padronale"
      4 =&gt; "Camera Figlia"
      5 =&gt; "Bagno"
    ]
    -pp: array:6 [▼
      0 =&gt; 5
      1 =&gt; 4
      2 =&gt; 2
      3 =&gt; 4
      4 =&gt; 4
      5 =&gt; 2
    ]
    -pl: array:6 [▼
      0 =&gt; 1
      1 =&gt; 1
      2 =&gt; 2
      3 =&gt; 1
      4 =&gt; 1
      5 =&gt; 2
    ]
    -pt: array:6 [▼
      0 =&gt; 1
      1 =&gt; 1
      2 =&gt; 0
      3 =&gt; 1
      4 =&gt; 1
      5 =&gt; 0
    ]
    -num_circuiti: 5
    -num_prese_telefono_dati: 3
    -illum_sicurezza: 2
    -spd: 1
    -imp_ausiliari: 1
  }
  </code></pre>
  
  <p>This should be rendered in a twig template as a table, much of the data is retrieved using a simple array access like <code>{{ item.string }}</code>.
  The fields named <code>floor, ambient, name, pp, pl, pt</code> should be rendered in the column, one row for item (you should see that in this example all the elements contains 5 keys).</p>
  
  <p>I've tried to access the array as usual but I got an error relating trying to access a key that in reality is an integer (shouldn't made?)</p>
  
  <p>here is the twig for loop that don't work:</p>
  
  <pre><code>{% for items in item %}
  &lt;tr&gt;
      &lt;td&gt;{{ items.floor }}&lt;/td&gt;
      &lt;td&gt;{{ items.ambient }}&lt;/td&gt;
      &lt;td&gt;{{ items.name }}&lt;/td&gt;
      &lt;td&gt;{{ items.pp }}&lt;/td&gt;
      &lt;td&gt;{{ items.pl }}&lt;/td&gt;
      &lt;td&gt;{{ items.pt }}&lt;/td&gt;
  &lt;/tr&gt;
  {% endfor %}
  </code></pre>
  
  <p>The error returned is: <code>Impossible to access an attribute ("floor") on a integer variable ("1").</code></p>
  
  <p>Expected Behaviour:</p>
  
  <p>These items should be rendered in the table, eg: row one, show <code>floor.0</code> value, <code>ambient.0.name, name.0</code> value, <code>pp.0</code> value, <code>pl.0</code> value, <code>pt.0</code> value`, column two etc.. </p>
  
  <p>Will someone got the solution to render it correctly?</p>