title: I want to genrate dynamic variable in TWIG and fetch value
body: <p>i want to set dynamic variable and get value of that variable. I had pass "orderDetails" to my twig template.</p>
  
  <pre><code>    $customerProfile = array(
        'ns1' =&gt; $customerProfile-&gt;getNs1(),
        'ns2' =&gt; $customerProfile-&gt;getNs2(),
        'custId' =&gt; $customerProfile-&gt;getCustId()
  )
  
  return $this-&gt;render('PortalBundle::popup.html.twig', array(
              'orderDetails' =&gt; $customerProfile
          ));
  </code></pre>
  
  <p>get that variable like {{orderDetails.ns1}}, {{orderDetails.ns2}} like this but i have 15 to 16 variable like this and i want to fetch this variable in loop.</p>
  
  <p>i have code for this like</p>
  
  <pre><code>{% for i in 1..13 %}
       {% set nsOrd = 'orderDetails.ns'~i %}
            {% if nsOrd %}
                  {{nsOrd}}
            {% endif %}
  {% endfor %}
  </code></pre>
  
  <p>i want to fetch variable {{orderDetails.ns1}} and other. Give me your suggestion.</p>