title: Twig - Use variable key for object
body: <p>I am using Twig and I have a problem.</p>
  <p>I have a problem when I want to use a variable index for an object.</p>
  <p>Here is my code:</p>
  <pre><code>{% for label, field in params.fields %}
      {{ dump(data.field) }}
  {% endfor %}
  </code></pre>
  <p>data is an object containing <code>{'email': 'test@test.fr', 'name': 'John'}</code>.</p>
  <p>Field is an array of string containing <code>['email', 'name']</code></p>
  <p>I can't show the value my object dynamically.</p>
  <p><strong><code>{{ dump(data.email) }}</code></strong> works.</p>
  <p>How can I use dynamic indexes?</p>