I have an array like this
'contents' => array(
'row' => array(
'col-xs-6' => 'grid 1',
'col-xs-6' => 'grid 2'
),
'row' => array(
'col-xs-6' => 'grid 3',
'col-xs-6' => 'grid 4'
)
)
Now I want to get the key from the array but failed, I have try with this code
{% for key, values in contents %}
<div class="{{ key }}">
{% for klass, contain in values %}
<div class="{{ klass }}">
{{ contain }}
</div>
{% endfor %}
</div>
{% endfor %}
Output:
<div class="row"><div class="col-xs-6">grid 4</div></div>
I don't know why it only appear once, but if I try changing the key name with different value and it works. Please help me. Thank you.