title: Passing Twig variables from array into an include
body: <p>I have an array I'm iterating over to pull in different types of components into my page:</p>
  
  <pre><code>array(
      'content'=&gt; array(
          'componentA'=&gt;array(
              'val'=&gt;'1',
              'title'=&gt;'sample title'
          ),
          'componentB'
      )
  )
  </code></pre>
  
  <p>I'm attempting to pass variables through from the array to the included template, but I'm not sure how to turn that string produced by the join into something that the include can understand as an array of variables. When I exclude the "with" from the first @components include, it prints out all the default values I've set in the iterable components like I would expect, but still gives me a white screen when I keep the with attribute in. When I display var itself, it returns this string:
  (Note, I've also tried putting quotes around the {{k}} to no avail)</p>
  
  <pre><code>{ val:'1',title:'sample title' }
  </code></pre>
  
  <p>How can I pass the variables from my array to my component?</p>
  
  <pre><code>{% for key,item in content %}
      {% if item is iterable %}
  
          {% set var = [] %}
          {% for k,v in item %}
              {% set temp %}{% if loop.first %} { {% endif %}{{ k }}:'{{ v }}'{% if loop.last %} } {% endif %}{% endset %}
              {% set var = var|merge([ temp ]) %}
          {% endfor %}
          {% set var = var|join(',') %}
  
          {{ include ("@components/" ~ key ~ ".tmpl",var) }}
      {% else %}
          {{ include ("@components/" ~ item ~ ".tmpl") }}
      {% endif %}
  {% endfor %}
  </code></pre>